We can estimate that using a simple formula that uses a few numbers we can research on line:
Cows/Year = (Cups of Milk per day * 365 days) / Cups of Milk produced by one Cow in a Year
The average dairy cow produces 2,320 gallons per year according to the National Agriculture Statistics Service or about 37,120 cups. The average person drinks probably no more than 5 cups of milk per day. So plugging in those numbers we have:
Cows / Year = (5*365) / 37,120 = 0.049 cows
So going from being a vegetarian who drinks milk to a vegan who doesn't will save about 0.049 cows.
But that estimate is too high because it's not obvious that farmers are going to see a demand shock of 5 cups of milk and attribute it to a decrease in demand. They might understand the decline as an unexplained shock and not let it influence their production decision. In that case not drinking milk has no impact on the cows.
A similar calculation on eating eggs yields:
Hens / Year = (5 eggs/week * 52 weeks/year) / 300 eggs per chicken/year = 0.86 chickens
Note: that is probably a high estimate on egg consumption.
Now here is an interesting twist. Let's say we think cows are worth 1/100th of a human. How many people would we have to save to cancel out the damage we've done by drinking milk?
It'd be the 0.049 cows divided by 100, or 0.00049 people. We can save people by donating anti-malarial bed nets which have been shown to reduce the mortality from malaria by about 44% in children under 5. We could donate them to children under 5 in Sierra Leone where the under-5 mortality rate is 193.6 per 1000 and where about 33% is attributed to malaria. When we multiply that out we have 193.6/1000*.33*.44 = 0.028 people saved per net. So we have to donate 0.00049/0.028 = 0.0175 nets to cancel out the impact on cows. Since nets cost $10 we have to donate 18 cents.
That doesn't sound too bad.