The top hat first began to appear in England during the 1800s, about the same time as the bowler. It was introduced and first worn in public by a haberdasher named John Hetherington as a variation on the riding hat which was covered with silk and had a lower and wider brim. According to a newspaper at the time, "several women fainted, children screamed, dogs yelped, and an errand boy's arm was broken when he was trampled by the mob." He was hauled into court for the crime of wearing "a tall structure having a shining luster calculated to frighten timid people."
By 1850 Prince Albert began wearing top hats, the first prominent social figure to do so, and the top hat soon became the last word in style. They weren't worn only for formal occasions, but also for business and pleasure. The common nickname "stovepipe" described both its shape and color and doubtless arose as a result of the developing industrial age. Lord Ribblesdale is immortalized in a 1902 portrait by John Singer Sargent wearing a top hat with a now-characteristic tilt, slightly forward and to the side.
The exact height and width of the top hat was highly variable, depending on the fashion of the day and the country. The invention of the collapsible top hat in 1823 by Antoine Gibus was a lifesaver for those French gentlemen who liked them as tall as humanly possible.
By the early 20th century the top hat was going out of style. Its frequent use by Fred Astaire in his movies of the 1930s (including, of course, the 1935 film "Top Hat" with Ginger Rogers) fooled Europe briefly into thinking the top hat had made a comeback in America, but the fashions of the 1920s had already done it in. By the middle of the century the shrinking size of automobiles made the top hat impractical, and today it lives on merely as a costume prop.
Sources: Columbia Encyclopedia, www.formalwear.org