It depends on the discipline, but usually around 18 years of age is about an upper limit. Jumping horses generally have the shortest career, with a lot of them retiring at 14-15 (or even earlier). There are more 16+ horses in eventing, and even more in dressage. Dressage championships in fact often have a couple of 19-20 year olds...
But it also depends from horse to horse and other such factors like injuries. Additionally, a lot of top horses that retire don't go straight to isolated fields, but instead they have a role of "schoolmasters" for younger and inexperienced riders.
Equestrian (dressage in particular) is generally a sport that very much helps preserve the horse, if done well. Through training they become more flexible and supple, and that's what they need to have long, healthy life...