Melatonin may be safe if taken appropriately, long - term, by the mouth. In some cases ,melatonin was used safely for up to 2 years. It can cause some side effects, however, including headache, short - term depression feelings, daytime sleepiness, dizziness, stomach cramps and irritability.