Each animal has a space requirement - you can see what it is if you look at the animal in the shop or in your inventory. It is denoted by a pen with a number inside of it. However, animals will only tolerate a certain number of their kind in an enclosure - this is denoted by the number on the sign.
This cow has a space requirement of 12, and you can keep up to 6 cows in a single enclosure.