Seems it is thermostatically controlled and when it reaches temperature it shuts off the gas and goes out because the 'by pass' is blocked. This is a drilling in the gas valve which allows enough gas though to the burner to keep the flame alight when the main valve closes. The by pass gas supply is regulated by a jet that is often screwed into side of the gas valve, or too one side of the control spindle at the front, clearing this is all that is necessary. If I am right then it is a straight forward job but there is a potential for a gas leak as the jet must seal correctly afterwardsa if you are in any doubt please get a competent person to do it.