All good things must end, and eventually your breeding horses won't be able to be bred anymore. The limits are much, much lower than realistic numbers (especially for stallions), but the limits are in place to prevent an excess of horses on the site, which would lead to tons of unwanted horses and a major shift in the way the grade scale works.
All mares are born with 3-4 breeding slots and can have a maximum total of 6 foals unless they are Select Sale or purchased custom mares. SS and purchased custom mares will start with extra slots and can have a maximum total of 8 foals. Stallions will always start with 5. Legacy and Robin's Nests can be used to help mares reach their max limit.
Stallions can earn extra slots before retirement through getting points and merits. They get 5-7 slots for gaining 50 points and then another 5-7 for gaining 100. After retirement, stallions can be given Legacy or a Victor's Blade to increase their foal slots and earn extra through being granted a status in the Stallion Incentive Program. (see this page for more information on SIP)
All horses gain +1 slots from achieving their Performance Distinction (PD) and for getting into the Court of Stars (CoS).
Your horses foal limits can be viewed on their breeding information pages and also on the mare/stud services pages.