Depends on the species, which are you referring to?
Humans have two so they can alternate. Gotta alternate or the other will get sore lol. We generally only have one baby at a time so more than two wouldn't be necessary.
Animals like Cows probably have four so it's easy for the calf to nurse from either side.
Animals like dogs or rats have multiple babies so they need more nipples to feed them all.
Sent from my SCH-I435 using Tapatalk