Fusion, as it occurs within stars, is in fact very unlike what happens in a bomb.
An "H-bomb" is actually a mixture of fission and fusion. The fission part works on a chain reaction: when a fissile nucleus absorbs a neutron, it vibrates madly and then splits into several components, in particular two or three neutrons. These extra neutrons go on breaking other nuclei. When the "critical mass" is reached, an average of more than one of these neutrons triggers further fission, leading to an exponentially increasing reaction.
When you want to do fusion, you have to convince the positively charged nuclei to come close enough to each other for strong interaction to overcome electrostatic repulsion. In controlled fusion, as is sought after in ongoing experiments like ITER, heat is used: the high kinetic energy induced by the severe heat is enough to push the nuclei together. Magnetic confinement is used to prevent the hot plasma from expanding. This is also what happens within a star: gravitation maintains the pressure. All of this makes for slow fusion.
In an H-bomb, though there is indeed a lot of heat, this mechanism does not contribute in non-negligible amounts to the fusion. The whole explosion implies a fireball which expands way too fast; there is nothing to keep the nuclei close enough. Instead, the primary (the fission core) produces a lot of highly energetic photons (X-rays) which travel at the speed of light, i.e. much faster than the emitted neutrons, and even more than the shock wave. These photons, when they reach the deuterium-tritium fuel, induce fusion (they yield enough energy to the nuclei to make them dance like John Travolta and bump into their neighbours). The fusion energy adds to the resulting fireball, and, crucially, emits a lot of extra neutrons which induce a lot more fission in the secondary (which again uses fission).
Thus, H-bombs explode fast because they are not, in fact, heat/confinement engines. Instead, they use the fission-based chain reaction to get a lot of X-ray and neutrons in a very short time; the fusion reactions add to the weapon yield, but their main use is to produce extra neutrons for more fission to happen. In a modern H-bomb, fusion and fission contribute similar amounts of energy to the total yield. The common explanation of H-bombs as "an A-bomb which sparks a much stronger fusion-based reaction" is flawed.
The Wikipedia page on nuclear weapon designs is a good place to start reading on the subject; it includes nice schematics and many pointers.
Within a star, there is an equilibrium between pressure from gravity, and expansion from the heat. The star's core remains at exactly the right temperature where the heat from fusion reactions counteract the gravitation. If the star is bigger, there is more gravitation, hence more heat and more reactions, which is why bigger stars live less long (very big stars will have a lifetime of a few millions of years, instead of a few billions for smaller stars like our Sun).
Others have pointed out that the proton-proton chain at works in most stars includes a slow step: when two protons fuse, they usually don't stay there, and separate again, reabsorbing the fusion energy. For the protons to stick, one of them has to morph into a neutron (emitting a positron with the positive charge), a process which involves the weak interaction and has only a very small probability of occurring.
This particularity explains why massive stars explode into supernovae. During most of its life (millions of years), the star consumes its hydrogen with the proton-proton chain. When enough helium has been produced, the alpha and triple-alpha process begin to take over, and then other fusion mechanisms, which are substantially faster. Things then happen within a few hours, a very short time compared to the previous millions of years, but still quite a lot longer than the microseconds during which an H-bomb detonates.
Summary: stars last for millions or billions of years, instead of mere hours, because of the weak-interaction step in the proton-proton chain. H-bomb go boom within microseconds, instead of hours, because they rely on a fission-based chain reaction, which allows for exponential cascading.