The younger the better, the older the more dangerous it is but not to the extent where you would avoid doing it. An older stallion the inguinel ring is the same size as the testicles, in a younger horse this ring is very small, so an older horse needs a stitch to be made in the ring before removal of the testes so that the chances of the intestine slipping through the ring and hole left behind from castration are reduced. Therefore they are usually castrated in hospital because of sterile conditions which makes it more expensive etc etc.
Some will say that in an older horse their temperament will not change, it does they do calm down, however a male horse will always have testosterone in his body, it will just be the level of testosterone as to whether he acts like a stallion even though he is a gelding or if he really is not interested in mares. Such like mares know that male horses mate so they will try to get a gelding to cover them, the mare ofcourse does not know the gelding has no wedding tackle.