Horses are known for being able to literally sleep on their feet.
It's a trait they share with other large herbivores including elephants, giraffes, moose, rhinos and bisons. Cows can also sleep on their feet, but tend to lie down more than horses do.
Most of the animals (some birds also do it for other reasons) that sleep on their feet are large prey animals. If they were cornered by a predator while lying down, then they might not be able to get up before it was on them (smaller herbivores such as deer have a higher power to weight ratio and can spring to their feet faster).
So, horses mostly sleep standing up, and only lie down to sleep when somebody else is watching - if you watch a herd of horses (or cattle) you might notice that you will almost never see all of them lying down at once.