Leaving it on 24/7 is clearly best for the lamp itself. The major factor that shortens the life of light bulbs is heating and cooling when they're turned on and off.
What's best for the tank is another question. Some would argue that leaving it on is good for the tank. Others might say that there is some benefit to letting small amounts of algae and bacteria escape being zapped by the UV. Personally, I don't know enough to have an opinion on that.