Mature cows can be milked once a day, assuming they are not-sick. Depending on their affection points and if they have won the Cow Festival they will give you small (100g), medium (150g), large (300g) or gold milk (500g). Milk is generally sold, but can be given as a gift (Elli, Rick, Zack, and Jeff, will enjoy it the most) instead. The quality does not affect how much the person will like it, so give them your least expensive.
When you buy a cow it takes 21 days to mature. Mature cows produce milk, are eligible to be entered into the Cow Festival, and can get pregnant. A pregnant cow takes 21 days to give birth and will give lower quality milk during that time. A calf takes 21 days to mature.
It is cheaper to buy your cows then to have them give birth. Cows are the second fastest way to a high income (yielding to the greenhouse). To get a cow to gold milk it must win the cow festival. To win the festival you need your cow to have at least 240 affection points and to have shipped at least 60 jugs of milk.
Secrets and Exploits
Cows give an unlimited amount of milk to your bottle; each drink gives you +12 stamina. There are a number of exploits to get your cow to high affection, quickly. Attacking a happy, sick or angry cow will increase its affection rapidly (though it might be sick for a couple of days; at least 15 hits should maximize affection). Alternatively every time a cow or sheep is left outside in good weather they have a chance to gain a large affection boost (represented by the "happy" status). As soon as they get this, leave them inside one day then put them outside again. This boost is meant to be a one-time reward, so over a week you can quickly rack up multiple bonuses.