What are they?
Medications or, in the case of melatonin, nutritional supplements that can advance or delay circadian rhythms.
Other examples are ramelteon and agomelatine (sedative and antidepressant medication respectively) that act on melatonin receptors.
Lithium, the gold standard medication for manic-depressive illness, may promote phase delays of circadian rhythms. Whether this is associated with its mood-stabilizing properties is unknown.
What are they used for?
The primary role of melatonin is in the treatment of circadian rhythm sleep disorders.
One recent study suggested a possible benefit in the treatment of Seasonal Affective Disorder. 
Ramelteon is a melatonin surrogate that was originally marketed for the treatment of insomnia. Subsequent studies document its ability to advance circadian rhythms.
Agomelatine, a melatonergic antidepressant, is not currently licensed in the U.S. Initial European studies describe rapid antidepressant activity, enhanced sleep, and improved rest-activity cycles. 
45. Kasper, S., et al., Efficacy of the novel antidepressant agomelatine on the circadian rest-activity cycle and depressive and anxiety symptoms in patients with major depressive disorder: a randomized, double-blind comparison with sertraline. Journal of Clinical Psychiatry, 2010. 71(2): p. 109-20.