I found an interesting paper that gives some numbers similar but slightly different from those in Pieter's source.
U.S. Equine Population During Mechanization of Agriculture and Transportation:
1900 21,531,635
1905 22,077,000
1910 24,042,882
1915 26,493,000
1920 25,199,552
1925 22,081,520
1930 18,885,856
1935 16,676,000
1940 13,931,531
1945 11,629,000
1950 7,604,000
1955 4,309,000
1960 3,089,000
But I also found a copy of 1900 Census information that shows the number of horses per 100,000 residents in the largest cities of the US (at that time). If I'm reading it correctly, cities with populations over 25,000 averaged 4,396 horses per 100,000 citizens.
As far as "how were horses sold," at least some were sold via newspaper advertising. In the Seattle Times, January 24, 1900:
18 HEAD of cheap mares and horses left, no work for them. One pair of 2,800 lb. horses, $200; one pair of $2,700 lb. horses, $160; one 1,000 lb. horse, $50; one pair of mares, 2,400, $225; one 1,100 lb. mare, $70; one 800 lb. horse, $25; one 1,200 lb. mare, $100. Cheap horses and buggies and wagons; trial allowed. Model Stables, 9th and Mercer.
Ladies' fancy gaited saddle horse; can take 5-foot hurdle; has won several races; took blue ribbon at state fair; with saddle and bridle, $250. Also tan riding boots, size 6. Mrs. Johnson, 3718 8th South.
$25 buys good work horse, weighs 1,350, age 8, guaranteed good worker every way; a prize for a man with little money. Bal. 1658. Phinney car to 8521 Dayton, Greenwood Stable.
The Seattle Horse Market, at 1737 1st Ave. S., holds regular auction sales every Tuesday at 1 p.m. All kinds of stock sold on commission. Main 3761. N.T. Jolliffe, prop.
WANTED--Sound, gentle driving horse, 8 or 10 years old, used to city life. Write 204 Marion Bldg.
There are a ton more ads in that day's paper, and they are fascinating, but I will stop with these. It really does seem similar to the way cars are sold today, doesn't it? And the cost of a horse could be relatively cheap, but like cars today, even an inexpensive horse was probably difficult for someone who was quite poor to afford to own and maintain.
I think, however, that people in cities and towns then were somewhat less likely to own a horse than a modern city dweller is to own a car today. And the reason for that is not so much the cost of the horse, but that our culture hadn't shifted to being car-centric yet. People did expect to walk more, but their lives were also more easily lived without personal transportation than ours are today. Back then groceries and prescriptions were commonly delivered, and every tiny area had its own shops. (In the early 20th century, there were six small groceries within 4 blocks of the house I live in today. Not to mention the hardware store, bakery, butcher, etc.) There were streetcars all over the place.
Now much of our environment is car-centric. We have big-box stores with giant parking lots where we can stop on our way home from work. We have areas that are very pedestrian-unfriendly. The streetcars are mostly gone, and buses rarely run as frequently as the older streetcars did. Not having a car in that kind of environment can be a hardship. But not having a horse in 1900, when the environment was far more friendly to getting around on your own feet, would have been far easier.