Here's the longest-term study I could find: http://www.ncbi.nlm.nih.gov/pubmed/19486273
Basically, children taking melatonin for several years didn't develop any problems. Melatonin is also used by blind people quite a bit, since without it their circadian rhythms are longer than 24 hours.
I believe it's not generally considered valid to apply results from medical studies on adults to children. I'm not sure if the reverse applies.
Full essay: http://www.gwern.net/Melatonin