Retiring & Pensioning
Retiring and pensioning can both be done from a horse's Manage page. Retiring a horse will remove a horse from your racing barn and into your bloodstock barn - still taking up a stall. Once a horse is retired, it can never race again. Pensioning a horse will remove them from your bloodstock barn and place them in your pensioned pasture - where they will no longer take up a stall. Pensioned horses can never race or breed again.
Racing horses cannot be retired before the age of 3. Colts and fillies are able to be bred at those same age (3), though colts will still need to meet requirements for public studding. (See breeding section) However, just because horses can breed at those ages doesn't mean they should. Your horses will not be allowed to retire (the option will not be available) until they have less than 10 races left in their career. The exception to this is if your horse is 15 years old or older, at which time they are too old to race and must be retired.
A general rule of thumb is to either watch for the 'Retire' button to become available or to watch a horse's Soundness. Once the button is available or Soundness drops below 100%, you should make plans to retire the horse at the beginning of the next game year. Retiring a horse mid-year is never suggested, since whether it is a stallion or a mare, it will be sitting in your breeding barn for several months serving very little purpose (eating food but earning no money). Though a horse with declining soundness has a slightly higher risk of injury and will perform minutely worse, they can still be good money-earners and can continue to earn points. Only when soundness gets dangerously low do you need to consider retiring a horse mid-year - otherwise, stick to January as your retirement month.
Note: If your horse is starting to lose soundness or has had their retire button appear, but you want to keep racing them longer, you can feed them Eternity to improve their longevity. As long as their longevity is greater than 0%, their soundness will stop declining even if it had dropped a bit. This is a great option for colts you are trying to get the last few points on for studding, or even stakes-quality fillies or geldings that you want to race an extra year.
Additionally, fillies who are born with less than 10 potential can be retired without racing. It's often still a good idea to race them, especially if they are peaking at a young age. You can still often get 25 points on them if you enter strategically, which can be slightly beneficial in the breeding shed.
Pensioning is typically done when a gelding retires from racing, as he has no value in your bloodstock barn unless you want to keep him for buddy training (timed workout). Once a mare or stallion has reached their lifetime foal limit, it is also time to pension them to free up space in your barn. Mares must reach their foal limit before they can be pensioned. Stallions may be pensioned at any time once they are retired, regardless of their foal limit or custom percentage.
You will not be allowed to pension a mare until she has reached her foal limit unless she is between 5% and 95% custom lineage, in which case she may be pensioned early. Since it can take a couple generations to breed a 50% back to a desirable number, many people would rather not breed horses who fall into this range. If you have a 50% mare with really nice genes and the potential to be a good producer, you might want to purify (Pedigree Purifier) and breed her. On the other hand, you are never forced to breed 5-95% mares who have bad genes and/or are terrible producers.