Same time everyday?

So I’ve just been taking the pill before I go to bed which is at different times. I heard that you have to take it the same time every night, is this true?