There are, in Minecraft, two kinds of pets you can have- Cats and Dogs. Dogs are by far the easier pet to get, and the most generally useful- but Cats are important as well.
Dogs are found in the wild as Wolves. Wolves are always gray, and can be found most often in pine forests (snowy or not) and deciduous forests. Usually, you will find a number of them clustered in an area, and not many in the rest of the environmental region. Wolves will generally ignore you unless you attack them or have a bone in your hand.
If you attack a wolf, it will fight you- and so will any other wolves within a certain distance of that wolf. This is generally a good way to get yourself killed, and is highly inadvisable. Particularly since it’s a waste of wolves.
If you ‘use’ a bone on a wolf, you will have a chance to tame it- if you fail, a cloud of black smoke will dissipate around the wolf, but you can always try again with a new bone. Once you have successfully tamed a wolf, it will gain a red collar around its neck and sit down. From then on, you have a pet dog. Dogs that are sitting, as your new dog is, will not do anything but remain where they are unless something attacks them. This is not exciting and not useful.
When a dog is standing, though, it will follow you. If you travel somewhere and leave it behind, every so often it will suddenly teleport near you. A dog that is following you acts like a wolf- except that it treats you as another wolf, automatically attacking anything that you attack or that hits you. Dogs will keep attacking until their target dies or they die- but you can help to avoid this. If you have any meat on you- even Rotting Flesh- you can feed it to your dog, and it will heal. You can tell when your dog is fully healed by the position of its tail- the higher its tail, the more healthy it is.
As of the 1.2 update, it is also possible to breed dogs. This works almost exactly the same as breeding any other domesticated animal, except that it involves using bones on the dogs, instead of wheat. This makes bones even more valuable- so if you intend to have a lot of dogs, it pays to find a skeleton spawner or do a lot of hunting in caves or in the middle of the nighttime.
Do be aware that dogs are not very tall- if you or the dog is attacked by the skeleton on a Spider Jockey, they will try to attack the skeleton and be unable to reach it because of the spider in the way. This is a very good way to lose your dogs.