I'm not sure if this qualifies as electrical engineering, but I remember my old physics teacher at school saying that if you switch a light on in a room and you're planning to return relatively quickly, it uses less electricity if you leave the light on until you return as switching the light on uses more eletricity than leaving it on for a relatively short period, but how long before leaving it on becomes more energy consuming than switching it off until you return and switching it on again?
The answer to your question can be found at http://energy.gov/energysaver/articles/when-turn-your-lights.
In short, it depends on what type of bulb you are using.
If you have an incadescent or halogen bulb, you save more energy if you turn the light off.
If you have a CFL
-If you leave the light unattended for less than 15 minutes, leave it on
-If you leave the light unattended for more than 15 minutes, turn it off
LED lights are more efficient in that they don't require as much of a "start up" current. They should be turned off in orcer to conserve the energy that would normally be dissipated during normal operation.
Its far more complicated than indicated by the "leave it on for 15 minutes". But for practical purposes, its about as good as it gets.
The physics professor was wrong- turning the light off will save energy (unless its less than a few seconds for a CFL). However, CFLs have a limited cycle life and cost a lot to replace, so its more cost effective to leave them on and use a bit more energy. One thing to consider is that it takes energy to replace a bulb - manufacture a new one, dispose of the old one, transport etc. This should be factored into any calculation as to when the ideal time to turn it off is. If the light is in a space that requires space heating, the heat it generates is not wasted, so leaving it on is not as wasteful as it might be, however, if the room is cooled, the heat needs to be removed, requiring more energy and turning off sooner would be more energy efficent