TM's are Technical Machines, they are moves that you pick up that you can teach your pokemon. They do not last though, you use it, it's gone.
HM's are Hidden machines, and unlike TM's, they never run out, but the moves cannont be deleated unless you use the Move deleater. HM moves are used to do different things in the game for instance:
HM01: CUT; Cut's down small trees, in Battle it's an ok move with a high Critical hit Ratio,
HM02: FLY; Enables you to fly from town to town, in Battle, it's a great 2-turn flying move
HM03: SURF; Enables you to travel on water, in Battle, it's a Great Move that hits all other pokemon on the field (except the user)
HM04: STRENGTH; Enables you to move boulders out of the way. In battle it's a great Normal Move
HM05: DEFOG; Clears out foggy areas, in battle it lower's the foe's evasivness
HM06: ROCK SMASH; let's you destroy cracked boulders, In battle it's a weak fighting move that may lower the Foe's defense
HM07: Waterfall: Let's you climb waterfalls In battle it's an ok water move
HM08: Rock Climb: Enables you to climb walls that have rocks in a line, In battle, it's a great normal move that has a good chance of also confusing the foe
Now remember that once you use an HM on a pokemon, it cannont forget this move, unless you use the MOVE DELEATER, He lives in Canalave city
Now with HM's, you have to beat Gym leaders in order to use them out of battle
Gym 1 enables you to use rosk smash
Gym 2 enables you to use cut
Gym 3 enables you to use fly
Gym 4 enables you to use Defog
Gym 5 enables you to use Surf
Gym 6 enables you to use Strenght
Gym 7 enables you to use Rock Climb
Gym 8 enables you to use Waterfall
here's where you get each HM:
HM01 (Cut) Eterna Forest
HM02 (Fly) Galactic wherehouse
HM03 (Surf) Cynthia's Grandmother in Celestic Town
HM04 (Strength) Old Lady in Lost Tower
HM05 (Defog) person in Safari Zone
HM06 (Rocksmash) Hiker at MT. Coronet
HM07 (Waterfall) jasmine in Sunnyshore city
HM08 (Rock Smash) Route 217
Hope this helps!