Dogs pant for a number of reasons, some of which are normal and some of which are cause for alarm. Generally, it's a normal thing that most dogs do as part of regulating body temperature. When your dog pants a lot, or more than usual, look for other symptoms of potential illness or environmental stresses, as the effect of his panting depends on the cause.
Generally, dogs pant as a means of cooling off. This is because when a dog pants, he releases heat through the moisture in his mouth and on his tongue. It is similar to the effect humans experience when they sweat -- moisture carries heat away from the body. Since dogs don't have sweat glands like ours, though, they release that moisture through their mouths, and the effect is a better-regulated body temperature.
Heatstroke is a condition that prevents an animal like your dog from cooling himself down, so if your dog is panting a lot, it could be a warning sign. Typically, a dog is able to cool himself down by panting, but in some situations, his body temperature is irregularly and dangerously high -- this may be the result of a too-warm environment or too much physical exercise. When your dog pants more than usual, the attempted effect is cooling down his body -- he may need veterinary attention, though, so monitor the situation carefully.
If you ever feel your heart race on a roller coaster or during a suspenseful movie, you know how your dog feels when he gets scared. In a stressful situation, like during a thunderstorm, your dog may pant as a result of his elevated heart rate and fear. Panting allows him to breath as quickly as his heart rate demands, getting him the oxygen he needs during a fearful situation. Keep calm and comfort him as best you can during situations like these.
Sicknesses like heart irregularities or even poisoning can make your dog pant a lot, so if he appears unable to stop panting, he needs to see a veterinarian. Respiratory problems like lung tumors or pneumonia can make it difficult for him to breath, causing him to pant. Cushing's syndrome, a problem with his adrenal glands, can also make him pant a lot. Whether it's a problem with an elevated heart rate, his lungs or something else, excessive panting is a sign that he should see a vet.