Your horse's whinny may be endearing or embarrassing, depending on when you hear it. No doubt you think it's charming when he neighs a greeting to you, but you may find it considerably less amusing if he lets loose with a high-pitched whinny when you're riding him in a show ring.
When a horse neighs, he is essentially saying "I'm over here!" or "Where are you?" He makes the sound by using his vocal cords, which are twin folds of membranes that stretch across the larynx in the throat. At rest, the vocal cords are open and relaxed, but when the horse wants to call out, the folds close and vibrate as he forces air out of his lungs. Faster oscillations, determined by how tightly the cords come together, create a higher pitch in the sound.
Young or insecure horses taken to shows, trail rides or other unfamiliar environments are likely to neigh often, as are mature alpha horses accustomed to controlling their herds. In both cases, the vocalization is instinctual---the horse is seeking the comforts of a herd by calling out for other horses he knows or might like to meet.
The trouble with whinnies under saddle isn't the sound itself---although it may make you cringe. Rather, it's that a horse who is neighing to other horses isn't paying attention to his rider or handler. The body language associated with a whinny makes this clear: The horse will typically stop, raise his head, stiffen his back and focus intently on distant sounds as he calls and then waits for a response.
To stifle a whinny, you need to redirect the horse's attention back to you. But resist the urge to yank on the lead or swat his neck. The vocalization comes from insecurity, and reprimands will only make the horse more nervous. Instead, give him a familiar task that will occupy his mind and make him feel more confident. This could mean asking him to back up a few steps, putting him in a strong and steady trot on the aids, or cueing him to move his hindquarters around.
If you know your horse is likely to start calling to others in a strange environment, work at keeping him engaged before the neighing begins. As he matures, the behavior will likely diminish.