What would cause a bathroom light to turn off during operation?
An intermittent problem like this could be caused by a combination of a loose connection and the waste heat from the bulb.  As the bulb and light fixture heat up, they expand eventually causing the loose connection to be broken, turning off the light.  With the light off, they cool down and shrink, remaking the connection so the light turns on again.

This could be dangerous as you could get arcing across the connection at the points where the light turns on or off, which can cause electrical fires.

To find and fix the problem:


Try a different light bulb; this will tell you if the fault is with the bulb or the fixture.  
Turn off power to the fixture at the service panel. Open up the fixture and check that all the connections inside it and in the ceiling box are secure.  Close up the fixture and reapply power.
If you're still seeing the problem, it's likely a fault in the light fixture itself.  I'd consider replacing it at this point (or there are repair kits, depending on your skill and comfort level with diagnosing the fault and doing the repair).