There are nine playable classes in Team Fortress 2, and are split up into three different groups; offensive, defensive and support. Included in the offensive group is the Scout, Soldier and Pyro. The Demoman, Heavy and Engineer are the defensive classes. Finally, the Medic, Sniper and Spy are from the support group. Here is some more information about TF2's classes from the official Team Fortress 2 Wiki:
Yes. In the upper right corner of the menu, it shows a random class, the longest life you ever had as the class and "Why don't you give him a shot?" except for the Pyro, where it says "Why dont you give her a shot?". It was hinted in Easter eggs that the Pyro is a woman such as the Yellow Flowered Purse in the locker on some maps, which hangs over the Pyros uniform.
There is much debate about whether the Pyro is a female or a male. Other classes' domination responses (Spy, Sniper, Scout, Soldier, Demoman, and Engineer) that refer to this speculation appear to be insulting the Pyro's fighting capability. The flowery purse located near its locker in the spawn room of 2Fort, as well as the Pyro's humiliation stance being quite feminine, have only served to further fan speculation. Additionally, the Pyro has been referred to…
Depends on what you are good at and like doing. If you like going all-out crazy, you should pick the Heavy, Demoman, or Soldier. If you like supporting your team, you should pick Medic or Sniper. If you like to be stealthy, be the spy. If you want a mix of all three, be the Pyro, Scout, etc Scout is best suited for dashing in and taking capture points.