Melatonin has been shown to be most effective in situations where your body needs to be entrained—that is, biologically synchronized—to the light/dark cycle of your environment.
As a supplement, melatonin works with your body clock, essentially "telling your brain when it's time to sleep." Research shows that melatonin may help you fall asleep more quickly, which can be especially helpful for people who struggle to fall asleep and wake up late the next day.
Some researchers believe that melatonin levels may be related to aging. Children's levels are highest, and they tend to drop as we age. Some research has found that lower melatonin levels may explain why some seniors have sleep problems, yet newer studies are questioning that conclusion—more research is needed to answer this question.