This Page was taken from Wowpedia
Companions cannot attack or be attacked in the normal sense, however, Willy and K.T. will kill critters, Rocket Bots will battle each other, and Thrashin' Robots "will fight other fighting robot companions", a PvP game within the game. Companions have a small hidden amount of health and can be killed by the pet swimming in lava, standing on fires, or other environmental means of damage.
You can own as many companions as you like. Each one you acquire is added to the pets section of your character sheet.
The Blood Parrot, spawned from the Admiral's Hat, and the Coyote Spirit, spawned from Carlos' Famous Hat, are exceptions and are summoned from the corresponding item. These are both items of apparel of some value in their own right, and having the item of apparel disappear when the pet is spawned would not be a welcome change. Because these two pets spawn differently than the other companions, they are not currently counted toward the pet achievements.
Peddlefeet, when spawned by being shot with a Shafted Arrow, is also an exception and does not count toward the pet achievements.
You can only have one companion out at a time, and summoning another one replaces the one that's already out.
Once summoned, companions will attempt to accompany your player character as you move about the game world. Some appear to be better at this than others. Jumping down from an elevated location will often send a companion off on a circuitous route to reach your new location. If your companion gets left behind, it may catch up and reappear, but may have to be re-summoned. There is no penalty for re-summoning. (The Tiny Snowman is stationary, and will not follow you.)
If you are teleported or use any form of transportation that reloads the environment your companion disappears and has to be re-summoned. The only ship or zeppelin that doesn't is the ship between Teldrassil and Darkshore, and the zeppelin between Orgrimmar and Thunder Bluff. If you log out your companion disappears and has to be re-summoned during your next session.
While some companions can only be purchased by certain factions, most vended companions and many dropped companions can be traded at Auction Houses. Companions obtained through quests are bind on pickup and cannot be sold. Pets you learn how to summon cannot be learned again, so you are prevented from owning duplicate pets.
Also, for some reason, most companions have 42 hit points.
-Can I Keep Him? grants 10 achievement points when you obtain a vanity pet.
-Plenty of Pets grants 20 achievement points (and replaces 'Can I Keep Him?') when you collect 15 unique vanity pets.
-Plethora of Pets grants 30 achievement points (and replaces 'Plenty of Pets') when you collect 25 unique vanity pets.
-Shop Smart, Shop Pet...Smart grants 40 achievement points (and replaces 'Plethora of Pets') and a Pet Carrier is mailed to you when you collect 50 unique vanity pets.
-Lil' Game Hunter grants 50 achievement points (and replaces 'Shop Smart, Shop Pet...Smart'), and a Fawn's Salt Lick is mailed to you when you collect 75 unique vanity pets (Added in Patch 3.0.8)
-Looking For Multitudes grants 10 achievement points and a Pug is mailed to you when you have grouped with 100 random people for WOTLK Heroic Dungeons. You must finish dungeons.
Some companions impact the game in some way. In particular, companions do not stealth. If your character uses stealth, your companion will reveal your presence. Mobs do not notice companions, so having one can be useful to indicate your location to party members. The  possesses both of these capabilities, unless they are inebriated.
A Oozeling projects a "Disgusting Aura" when it accompanies its owner. The aura reduces the owner's defense and all resistances by 20, and colors its owner green as if the owner were poisoned.
During and shortly after the Love is in the Air seasonal event, Shafted Arrow can be shot at your opponents to mark them with a Peddlefeet companion.
Flying pets of any sort can sometimes interfere with clicking to target. This affects the pet owner, PvP opponents, and even party members desiring to buff or heal the pet owner. This is not normally a significant problem, but in the midst of frantic PvP combat, the interference can be noticeable.
The Soul-Trader will vend several items to its owner. One of these, Ethereum Essence, is designed for being used in combat (but see of Detect Lesser Invisibility, the impact is minor). The other items are a set of costume items with no stats that allow you to dress up as an ethereal, a ball that can be played with in-game (there are others, such as Leather Ball), Mutagen, which will transform a non-combat pet into a fleshbeast, and Liqueur, a conjured alcoholic beverage.
The Parrot and the Spirit are spawned from items rather than learned, and are not currently counted toward the pet achievements. Similarly, the Thrashin' Robot created by engineers remains an item due to its cooldown characteristics.
There are companions that can be acquired for a time that aren't normally regarded as companions, but pretty much do the same thing as permanent companions. Many of these are in the context of a quest. Some examples are the orphans for Children's Week, Peddlefeet from the Shafted Arrow, Nass from N  Kickin' Nass and Takin' Manes. None of these count toward the pet count achievements. When a temporary companion is spawned your current companion is despawned.
Note: The Snufflenose Gopher might appear to be a temporary companion, but will draw aggro like a combat pet, even though it does not fight.