.htm goes back to the days when PCs were forced to use the 8.3 DOS naming convention (eight characters, then a period, then a 3 letter extension). But yes, for all intents and purposes, they do the exact same thing.
All of these files types are just HTML (HyperText Markup Language) code. A .HTM and a .HTML file are identical, simply different extensions. They do the exact same thing, but most people try to stick to .HTML because this is the way is was originally intended. The .HTM extension was used for operating systems like Windows 3.x that did not support long file names.