Assuming you mean security nor for yourself (as in, to see where you're walking) but for burglars, thinking about this for a bit I'm not sure if this always works as intended. Would be interesting to see stats. But it's definitely not as simple as 'light on = scare away intruders'. Suppose your hallway light goes on every single day, even if you add some randomess to the timing, a burglar which scouts the neighbourhood a couple of days will quickly figure out the light being on doesn't mean anything with respect to you being at home or not. Moreover it would be convenient for him/her once inside the house since there's more visibility. Unless of course that also means the neighbours can then clearly see someone being in the house. Then again, if your neighbours don't know you're not at home that matters less.
edit seems it's indeed a point of discussion https://skeptics.stackexchange.com/questions/8956/is-it-safe...