The answer is simple. It all depends. There are many kinds of light bulbs these days: halogen, fluorescent, LED, incandescent, etc. Depending on the bulb, the answer varies:
With incandescent bulbs, it’s smart to turn them off whenever not in use. These bulbs have been around forever and are among the least efficient. For instance, only 10% of the electricity they consume produces light. The rest is heat. Turning these bad boys off will keep a room cooler. Turn them off whenever you can.
Fluorescent bulbs are more efficient, but the benefits of turning them off is a little less clear cut. The general rule of thumb is if you are going to leave a room for more than 15 minutes then turn the fluorescent off. If less than 15 minutes, then leave it on. But be warned, turning fluorescents on and off will dramatically reduce the life of the bulb. And these lights are not cheap.
The operating life of the newer LED bulbs or light emitting diodes is not diminished by turning them off and on. This makes them perfect for motion-detection lights that need to go on and off frequently. Definitely shut an LED light off when not being used.
Halogen bulbs are more energy efficient than incandescent bulbs and produce a soft, relaxing light. However, even when you turn a halogen off, their transformer is still drawing on the electric current.
Turn them off, put know that they still are costing money.
By and large, turning lights off when not in use will save on electricity. But remember, depending on the variety of bulb, it may reduce the operating life of the bulb and require more you to replace bulbs more often.