Could also just be that the valve is stuck and sucking all the power from the generator, which would then cause the pilot to close.
Your pilot is burning next to a small thermopile (pilot generator) which converts heat into electricity and creates enough power to open and close your gas valve for both the pilot and the main burner. To light the pilot you hold the valve open manually by pushing down the knob on top, but once the generator is working it holds the valve open for you. If you disconnect power from it, or the power shorts out to some other component, the pilot goes out.
It's not likely that it's just shorting out onto the safety circuit if nobody's touched the wiring, but take a look around the valve and make sure a mouse hasn't gotten in there and chewed everything up.
If that's clear take something small and hard, maybe the backside of a screwdriver, and tap the gas valve a few times and then try turning the heater on a few times. As I mentioned it could just be that the valve is stuck and sucking all the power from the generator since it's not used much.
If you have a volt meter handy, set it to DC volts and check the power from the generator. It should read between .3 and .6 or so with the pilot on. See what it does when the heater tries to turn on.