Good hygiene is needed for geldings and stallions and should be a part of regular grooming.
The horse on pasture is just as likely to need it done as the horse competing. Generally speaking it's more neglected on geldings than stallions, who are usually maintained better due to breeding. Geldings are often let go until it's a problem expressed by bucking, rearing, kicking or other undesired behavior.
There are health reasons also - horses neglected can end up with severe infections. The skin of the sheath secretes a substance called smegma. When this builds up with dirt, bedding, sweat, skin debris and such it forms hard lumps, some like small rocks. This collects on the inside of the sheath along side the horse's penis. A small lump, called a bean, can harden and become painful. It can become painful for the horse to urinate, and some horses then don't "drop" to urinate, making the situation worse. If you've ever seen a stallion or gelding dropped and see debris collected on him - he needs his sheath cleaned! If you notice a bad odor near him or streaks of "gunk" on his legs - it's time to get him done.
Sheath cleaning is distasteful to most owners - so even those who know it needs done put it off. It is not difficult to do if your horse accepts handling. On a difficult horse you might want a veterinarian to give a small dose of tranquilizer - and keep in mind that some horses this does not work! I knew one colt it actually made WORSE - instead of getting sleepy he went on the fight and began kicking and trying to walk over handlers.
Collect your supplies. You'll need a mild soap such as Ivory or, better, a product called Excalibur which is developed for sheath cleaning. Vaseline to help coat the debris and soften it to remove it. Warm water. A sponge, disposable latex gloves and a reliable, experienced handler to hold the horse. Start by gently wetting the area down - up inside the sheath. Use a very gentle pressure doing this. Use plenty of soap and gently wash up inside the sheath, working quickly and gently, getting the folds of skin as thoroughly as possible. Rinse thoroughly. Repeat this until you no longer feel debris inside the sheath. If he's very dirty (some horses tend to be worse than others) use vaseline to soften the debris and make it easier to remove it without irritating or hurting him.
Be sure to position yourself so you can feel if he's going to kick and push him off balance. For this reason until you know how he'll act don't simply tie him up. Restraining his head prevents accidents.
Young horses - under two - seldom have a problem but smart owners and breeders will "go through the motions" teaching them to accept this procedure as a part of routine maintenance. Many spend time training them to accept being wormed, shod, teeth checked etc and yet forget the importance of cleaning the sheath and it's so much easier to teach them to accept this when you're teaching them everything else. Another advantage - they see it's no big deal and they're accustomed to the procedure before they're dirty and uncomfortable.
How often this needs done depends on the horse. Some stay relatively clean while others bring the mud with them. If as he works or plays he gets a lot of mud on his belly you'll probably find he'll need done more than the horse who doesn't. Some horses can get by with 3-4 times per year, some once a year, some once per month. It's part of keeping a gelding or stallion.