I believed that the top hat died off at the beginning of the 20th century. It turns out that, at least for very formal occasions like Inauguration Attire, the top hat still was worn by no less than President Kennedy in the early 1960s. (Then it died off. But still, that is quite remarkable.)
Here is Kennedy and Eisenhower and the former’s inauguration. You can also see men in the background wearing less formal hats. By the 1960s, however, the only hats you would see on men would be informal caps. The notion of formal headwear for most men ended here.