Mercenaries were introduced with SoD, and you must have this expansion to use them.
You can buy mercs in Plane of Knowledge, or in any of the racial home towns - but for that race only. There were initially two types of merc - tank and healer; these correspond very closely to the player classes warrior and cleric, and you can only get the corresponding merc from races that can have warriors or clerics; a few additional merc liaisons exists for non-player races (minotaur, siren, clockwork, etc). You buy male mercs from male mercenary liaisons, and female mercs from the females. You can only have one merc at a time - to switch to a different type of merc (or upgrade to a new tier) you must first dismiss the old one, and buy a new merc.
In Underfoot, two new types of merc were introduced: melee and caster dps mercs (corresponding to rogues and wizards). At low levels, tank mercs are higher dps, as well as tougher.
Mercs are free at very low levels. Players rarely have problems getting enough money to pay for their mercs, but it is a very good idea to make sure that you have enough pp on your character to keep your merc paid. This is especially important if you use shrouds; suspend your mercs before shrouding!
Journeyman mercs are much better than Apprentice mercs, but have one weakness - they are more prone to run away. This behaviour is only triggered when your group has aggro from several higher level mobs, so is highly unlikely to happen when solo or duo.
Mercs also level with you, although a display bug means that you don't see their level increase until you zone or camp - they damage/heal amount increases as you ding.
Up to about level 70, tank mercs are significantly more powerful than mobs of the same level, and need little if any healing when one to one. Most classes should use tank mercs to at least 60 for this reason. Past this level, tank mercs become increasingly feeble, although buying higher tier mercs enabled through SoD Void access progression partially compensates for this problem; you can start these quests at 75, but would need a lot of help at that level to complete them. To obtain a J5 merc, you only need to complete the Korascian Warrens progression quests. Most higher level players will have access to a healer merc, if only for rez on demand and buffs.