When pets are healed, they do not gain XP. Healing items do not count as food either, so you always need to feed your pets after healing them (if you haven't fed them yet). You can feed them multiple healing items, until they're max health. Pets can be healed by feeding them:
A pet needs to be fed at least once every 72 hours. If 3 days pass without feeding, if you give it unsuited food or if you lose a battle, your pet loses 1 HP.