I'd say 5-6 weeks. And if 6 weeks, barely so...
The attached pic shows my pup (who is now a year + a month old!) through the very early puppy weeks.
I just showed you pictures of a healthy puppy from a good breeder. That's a breeder who bred to standard. That's a breeder who is feeding pups properly + caring for them properly.
When you mention "farm", that brings to mind very careless and rough situations for pups. That can include parasites which DO affect growth. But there's also cases of pups being a bit off the track in development because of feeding, care, breeding behind them.
If you were considering purchasing a puppy - most of us would tell you NOT to look for a "farm" whatever that means. o_O And there probably were red flags which people would have pointed out to you.
However, you have the pup now. And quite honestly, I hope you give that pup all the love and care he/she needs.
Dangers of bringing home a very young pup DOES come down to diseases and parasites. By 4 weeks, breeders may begin weaning pups off of mom. She's still going in to feed her babies, but they are also getting cereal (like porridge or cream of wheat). And breeder continues to wean mom away from the pups from that point on.
Pups abruptly rehomed prior to 7-8 weeks are vulnerable to all kinds of viruses + due to the stress on their system, they are also prone to developing internal parasites or conditions like coccidia, which would make things very rough during that transition + could kill them is not treated properly.