A stable master is an NPC that offers hunters the opportunity to store four pets and retrieve them at any other allied stable master. They are typically found outside most city and town inns or near the pet trainers. You can ask the city guards where they are when you are in major cities. In other locations where city guards are not present the minimap tracking feature will show a horseshoe icon () at their locations.
To stable a pet, right-click on the stable master to open the stable window. You will see your current pet displayed as an icon on the left side of the window. On the right side are four slots (two prior to patch 3.0.2). Depending on if you purchase to open the slots, they will be either active, or red to show you still need to unlock them. The cost of the stable slots is as follows: 5 for the first, 5 for the second, 50 for the third, and 150 for the fourth. Just click and drag your current pet's icon to any stable slot on the right to stable it. If another pet is in that stable slot, that will now become your active pet.
As of Patch 3.0.2 players may use stable masters to recover lost non-combat pets rewarded by quests at any stable master. Restoring a lost pet will not reward the pet item, but rather store the pets' spell directly in the pet collection. E.g. – Quest Reward from [59D] can be restored if you destroyed the item but have finished the quest.