A lot of people think that there are big ranches where movie horses hang out between films. This used to be true in the heyday of the western, but it's no longer quite true.
While some of the horses you see in movies are owned by the "livestock coordinator" - the person hired to make sure the movie or TV show gets the horses they need - these are mostly elite trick or stunt horses. Stunt horses in particular are extremely valuable. And yes, there are a few ranches. The Devils' Horsemen in Buckinghamshire provides the horses for Game of Thrones - and when not filming the horses give lessons, mostly to actors. The Dent family also has a big ranch, in Hertfordshire - the biggest. And yes, those are in England.
The majority are not. In some cases horses may be purchased for a production and then sold afterwards (resulting in those feel-good stories about the actor or stuntman who bought the horse they were working with - these horses don't generally end up in bad places if sold as they're by definition good tempered and if they weren't bombproof before...) TV shows that need horses for season upon season generally do buy their horses. Mr Ed, for example, was played by two horses - Bamboo Harvester was the actual actor (who was trained to move his mouth on cue by using his favorite treat) and Pumpkin was the horse's body double.
It's more common, though, for these horses to be leased or rented for the production. If a producer needs a horse that can carry a 70 year old actor who can't really ride for a scene or two, then the wrangler is likely to call up a lesson barn or dude ranch and borrow a horse. (I knew a lesson horse who also did quite a bit of film work). Horses for racing scenes might be rented from trainers. The 1969 western Undefeated required 2,500 horses - the most ever - and the majority of them were rented from local ranches. Some "specialty" stunt horses are also owned by private individuals.
Finally, sometimes a production will put out a call for mounted extras - in this case, the riders bring their own horses. This is more common for very simple scenes or, for example, if filming at a horse show then the other riders may be local show people.