I think it depends on the cause. My son has autism, and he never slept good as a baby, toddler, and even up to until half year ago until we started taking melatonin, and good amount of it (he is almost 17 now). It turns out people with autism and attention deficit disorder do not make enough melatonin. I wish I would have known it, when he was a baby. Melatonin is very safe, and studies with animals, that wanted to see, what is the toxic dose, found that animals taking large doses lived longer instead of getting poisoned. That said, people when they reach puberty naturally reduce melatonin for a while to allow maturation to happen. Also very large doses such as 75mg or more a day is used as contraceptive, so if one wants to have children, do not use a lot. Melatonin is also veryprotective against radiation, so it is great to take before and after xrays, and now daily because of WIFI and cell signal radiation.
For me personally, I find, that I get best results for sleep, if I take both - melatonin and some sleep herb in tincture, powder, or tea form -passion flower, kava kava, valerian, triphala combo (that has haritaki -sleep herb). For my son melatonin doesn't kick in until at least an hour, but stays in his body until morning. For me it kicks in almost immediately, but doesn't stay long. So I have it near the bed, and if I wake up, I take a bit more. I use pure powder without fillers. study showed, that people metabolize it very differently to the point, that it can be 300 percent difference, which means some people need much more to get the same effect.