There was a MIT study that the optimal doaage for sleep is around 300mcg.
The body produces about 30mcg of melatonin afik, and the oral bioavailability of melatonin is about 10% so, the math works out.
More might produce excessive grogginess after you wake up, and in my experience it leads to fast tolerance -- so it doesn't work; 300-450mcg works in perpetuity for me.
The precise dose that works for you may vary, but a significant sign you've taken too much is feeling really tired and groggy the following day. For me up to about 1mg seems to work fine but I've not used it enough to see how well it works below that.
More might produce excessive grogginess after you wake up, and in my experience it leads to fast tolerance -- so it doesn't work; 300-450mcg works in perpetuity for me.