Glowsticks (and to an extent their biological cousins, the firefly) use a process called chemiluminescence to produce light. Most common glowsticks use hydrogen peroxide in an ampule which is broken when you snap the stick and is mixed with a liquid called ester to start the chemical reaction.

Differences between the duration and consequently brightness of the reaction is dependent on the amount of hydrogen peroxide provided. Larger amounts of hydrogen peroxide will produce a faster and brighter reaction. Lesser amounts will of course produce a slower and dimmer reaction.

Lowering the temperature of a glowstick will of course slow down the chemical reaction time; raising the temperature will speed it up. Your average "rave-quality" glowstick will survive 5 hours in normal situations (even less if you hit me upside the head with it while I'm lost in a jig).