How long it takes for melatonin or gabapentin to start to work for sleep disorders?

Don't know for sure. It depends. There is a wide range of doses that can be used. It may take days or weeks of dose adjustments before we get a good response. On any particular night even after dose adjustments some patients report drowsiness within an hour while some may lay awake the whole night. Gabapentin is "off label" for sleep disorders. Melatonin is over the counter and not fda regulated.