Possible reasons why a pilot light may not stay lit include a problem with the thermocouple, a dirty pilot tub or a strong draft. A problem with a pilot light may cause a gas leak should be fixed immediately.
For appliances that use a thermocouple to regulate the flow of gas, an improperly functioning unit may be unable to detect the flame. When the thermocouple is unable to detect the flame, it turns off the supply of gas. Typically, problems with the thermocouple result from dirt or damage. Dirt in the pilot tube may be restricting the steady flow of gas, causing the pilot light to go out.