The most common width to height ratio rates in the "old good" paper photography seems to be 3:2, which was adopted by today's DSLRs. Early (non-professional) digital cameras adopted 4:3 aspect ratio, which was the industry standard for computer monitors and for consumer TV sets. Prints are often 5:4 (as in 4"x5" or 8"x10"). Wide-format monitors are 16:9. Does anyone have any idea where and why these aspect ratio conventions were adopted in the first place?
Originally, film formats were arbitrary and specific to each camera model, but eventually some standards emerged. Even within the standards, there's a whole lot of 'em to choose from. But here's some common formats and a bit about their histories:
Thomas Edison's lab chose this aspect ratio for silent film, and it became the standard. No one knows exactly why this particular ratio was chosen, but there's plenty of speculation. Adding room for the soundtrack changed the standard slightly, but it's still the foundation. That translated to television sets, and then to computer monitors, and therefore was a natural choice for early digital cameras, and of course continues to today.
This is also roughly the proportion of a "full plate" (or "whole plate") used in Daguerreotypes or tintypes, from before cinema. This format is 6½"×8½", which is roughly 4:3, give or take the oddness of the half inch. Cutting this various fractions was also common, and although the resulting sizes were not consistent, the smaller sizes usually stayed to approximately-4:3 aspect ratio.
William Kennedy-Laurie Dickson, the engineer working in Edison's lab on the film project, was an amateur photographer, and it's possible that his experience there influenced the choice for film.
Wider formats eventually came to cinema largely as a way to distinguish the attraction of theaters from home viewing. See this for more, or search for "Academy ratio" and you'll get lots of information. This comes back around to photography when we get to the 16:9 aspect ratio discussed below.
It's worth observing that 4:3 and 3:2 are geometric cousins, since halving or doubling a 4:3 frame (in the sensible dimension) yields a 3:2 frame, and halving or doubling 3:2 yields 4:3.
110 film, a basically-failed cartridge format for mass-consumer-level cameras, uses a 13mm×17mm frame, which is close enough to 3:4 in spirit — although oddly the standard prints are 3½"×5", or 10:7, a "weird" ratio partly between this and 3:2.
This is the format of 35mm film and the de facto standard for digital SLRs. Oskar Barnack of Leitz invented a small camera using cinema film rolls, and chose to use a double frame — and a double-4:3 frame is 4:6 — which is to say, 3:2 when you turn it 90°. This is the origin of the 35mm film format, and here we are today.
(Beware when searching for more on this; there's an oft-repeated article out there full of unwarranted golden-ratio mysticism.)
Japanese camera makers Nikon and Minolta used a 4:3 format in their first 35mm film cameras, but then switched to 3:2 along with everyone else — possibly for political reasons, but possibly just for convenience.
When the Advanced Photo System standard was invented, "APS-C" was defined to follow this Classic aspect ratio (in a smaller size). APS also defined APS-P (a 3:1 panorama), which didn't really catch on; and APS-H, which is close to but not exactly 16:9 (but probably chosen for its similarity).
Squares are obvious, and nice to compose in. There's no concern about "portrait" or "landscape" orientation. Interestingly, analysis of historically-preferred aspect ratio in painting show that with no inherent restrictions of format, artists tended towards more square. So, conceptually, this is pretty straightforward.
However, it appears that the various non-square rectangles were the norm until Rollei's twin-lens cameras came along. These use a waist-level finder you look down into, and it'd be inconvenient to have to tip the camera for different orientations. Hasselblad followed suit with their waist-level SLR, again using square format.
This is a common large format aspect ratio, both as 4"x5" and 8"×10", and that's where the popular 8"×10" print comes from. I'm not sure why exactly it was chosen, but I wouldn't be surprised it simply fits with the historical preferences for almost-square frames as noted above. It certainly goes back to at least the 1850s — see the bit on cartes de visite below.
This is another aspect ratio one commonly sees available for prints and in pre-made picture frames. It was a moderately-popular large-format option which seems to have mostly fallen out of favor, perhaps because it's "too in-between" — inconveniently large to enlarge, smaller than people might prefer printed directly. I found a couple of interesting articles on the format (here and here), but I haven't found any particular reason for the aspect ratio; it seems to just have been an acceptable arbitrary choice between the other common sizes of 4"×5" and 8"×10".
Since 8"×10" can be cut in quarters for 4"×5", it seems logical that half-sized film would also have been common, and indeed cameras using the more logical-seeming 5"×8" format also exist/existed, but for whatever reason never got to be as popular as 5×7.
This is particularly interesting because 5:8 is a very close approximation of the golden ratio, and maybe this is an argument against people's natural attraction to that. (See this 1891 article, where the author says: "I would recommend the 6½×8½ in preference to the 5×8, since for most work the latter is not so well proportioned.")
One common format with this aspect ratio was popular in the 1860s — the carte de visite, a 2.5"×4" "business card". There was a technique for taking eight such photographs on a single 8"×10" plate, which explains the aspect ratio choice, although especially given the timing it may well be that the golden ratio played some part. This format, though, was supplanted in a few decades' time by larger 4:3-ratio cabinet cards.
The Aspect ratio (image) Wikipedia entry has some answers to this question.
From that article, many aspect ratios derive from the 35mm film, the image size in number of perforations of that film and whether room has to be left for soundtrack.
There's a serious 16 min video on YouTube that shows the historical evolution of film formats in movies. It illustrates the already complete answer by @mattdm with a visual presentation of the ratios and further explanations about really widescreen movie formats, some of which have been abandoned forever.