For a hunter, and especially a Beastmastery hunter, a pet is so much more than just a tag-along with some extra damage. It plays the first and primary role of keeping enemies away from you while you shoot at them from range when you are by yourself, and in a group it can have a number of utilities too. Each pet has its own particularities can have a big effect on how you play and what you can do in the game.
Most of these particularities don't matter for the beginning hunter, however. In fact, most of the pet types are only available to you much later on in the leveling process. At level ten, the most important factor in choosing your pet is just whatever looks nicest to you, unless you already have some experience as a hunter and you know of some particular pet ability (such as charge or furious howl) that matters to you.
A hunter's second-best friend
There's actually a lot of complexity involved in pets that can be somewhat daunting for a new hunter to grasp at first. To help you in this process, you will find that Mania, the lady behind Mania's Arcania and Petopia, will become your second-best friend (after your pet itself, of course), and can teach you everything you need to know about choosing pets and taking care of them. Mania's series of articles called "Choosing Your First Pet" takes you through all the starting areas for each race and highlights the best choices for you, clearly explaining the pros and cons of each pet. "Name That Pet" is also a handy feature of hers that can provide a lot of inspiration on your pet's name.
You can go to Mania for all the details, but I'll just briefly lay out the essentials you need to know in order to make proper use of your pet from the very beginning.
Your pet has feelings too
First of all, your pet has a range of emotions from "happy" to "unhappy" which will affect how much damage it does, as well as how many abilities you can train it with. Your pet starts out very unhappy, and if you let it stay that way it'll run away before too long. You'll need the right kind of food for your pet to eat, using the "Feed Pet" ability. Get used to feeding your pet regularly is a good habit. I keep Feed Pet on my action bar right next to where my bags open up, along with the pet food of choice right next to it, so that I have whatever food I might need readily available in a small area of the screen. Some hunters swear by various macros or addons for pet-feeding however.
Pet school is in session and you are the teacher
As you keep your pet happy and travel around killing things together, your pet's loyalty will increase, giving it more training points and allowing you to teach it new stuff! The only ability which does not require any training points is Growl, which keeps enemies attacking your pet instead of yourself, and which you can learn from the pet trainer near the hunter trainers in your capital city. This pet trainer can also teach you various passive abilities which can increase your pet's stamina, armor, and other things too.
In addition, it's a good idea to check out Petopia to see which active abilities are available to your pet of choice and set about a plan to acquire them. In order to do so, you have to find out first of all which abilities you want, and then which animals can be trained with that ability included. Put your regular pet in the stable for a bit while you go out to tame the animal that has the ability you need, then fight with that new animal till you discover yourself having learned the abilities that animal can use. In some cases (especially if an ability has a cooldown), you may find that this can take a while, but be patient and have faith that you will learn the ability eventually. Sometimes it can go really fast and just take a few moments.
To help you out with this, you'll need access to information. Mania's recources are great for making choices about what pet you want and what their abilities mean for you, but it can be a pain to leave the game and check some website just to find new abilities or upgrades to existing abilities once you know what you need. Do do this from within the game, you will find the addon "Fizzwidget's Hunter Helper" very useful. It enables you to search all pet abilities by name, and it tells you where you can go in the world to find the ability you want.
You'll also find it handy to make simple macros to facilitate your control over your pet's behavior: "/petattack" -- commanding the pet to attack your current target, "/petfollow" --commanding the pet to stop fighting and follow you, and "/assist pet" -- to switch your target to whatever the pet is attacking.
There's so much to learn about pets in the game, but this should suffice for a beginner just getting started, and also help lead to valuable resources which will prove invaluable later on. If you're a new hunter and you have any questions about pets, feel free to ask below; and if you're an experienced hunter who wished he or she knew something about pets from the outset, please share your wisdom in a comment as well.