When you get a pet it will be an egg. You will need to wait for it to hatch before you can equip it. You can see how long you have to wait for a pet to hatch by moving your mouse over its name in your backpack.
After your pet egg hatches it will be a Baby pet. It can gain experience to increase its rank to Teen, Adult, Ancient and Epic.
Your pet gains experience from playing pet training games in the Pet Pavilion. The Pet Pavilion can be found through a tunnel from the Wizard City Commons, close to Prospector Zeke.
You can play the four pet training games by using the minigame sigils around the Pet Pavilion: Pet Cannon Game, Pet Maze Game, Pet Drop Game, and Pet Dance Game.
You need Energy to play pet training games. The Energy globe is next to your Health and Mana globes. You can also see your Energy by pressing C to look at your character in the Spellbook.