Melatonin is a neurohormone secreted by the pineal gland in the brain and it is well known for causing and regulating sleep. Light suppresses melatonin synthesis. The primary use of melatonin as a supplement is to normalize abnormal sleep patterns.
Irregular sleep patterns are associated with a wide variety of health problems and premature aging. Melatonin is the hormone used by your body to help you fall asleep, and thus supplementation is seen as a way to get regular sleep. This is particularly useful for people who engage in shift work or are jet lagged.
Melatonin may also have general neuroprotective effects, related to its antioxidant effects. Melatonin also has several anti-cancer properties, and is currently being investigated for its role in fighting breast cancer, although human studies on the topic are lacking.
Melatonin does not appear to have much of an effect on lean mass or body fat, but potentially stops your body from gaining more fat. Melatonin supplementation also benefits gastric (somach) health, possibly reduces tinnitus, and improve mood (by helping you get better sleep).
There are some demographics that tend to have irregular melatonin production in their body. Smokers tend to be less responsive to supplementation, and older people tend to not produce as much during night time. Depression has also been associated with lower melatonin levels.
In typical dosages, melatonin appears fairly safe. Side effects are both uncommon and usually mild, including daytime sleepiness, headache, and nausea. Very rarely, serious adverse effects resulting from melatonin supplementation (often in very high doses) have been reported.
Taking melatonin is not associated with negative feedback (when taking supplementation causes your body to produce less of a hormone). It is also not addictive.
Melatonin’s primary mechanism is by helping decrease the time it takes to fall asleep (as a hormone, that's its primary job).