It could take just 15 to 30 minutes for melatonin to start working in a dog. However, it could also take longer—about one to two hours. As with any new medication, it's essential to start off with a small dose of melatonin and then wait to see its effect on your dog.