It would depend on the type of depression. If it’s due to an event, that’s called situational depression and sleep can help, but not necessarily get rid of it entirely. Often it simply takes time.
If it’s depression of the mental illness type, unfortunately, no, sleep won’t cure it. If you’re in the middle of a bad bout of it, sleep won’t even help much, but it’s good for us and we need sleep.
The longest recorded time without sleep is approximately 264 hours, or just over 11 consecutive days. Although it’s unclear exactly how long humans can survive without sleep, it isn’t long before the effects of sleep deprivation start to show. After only three or four nights without sleep, you can start to hallucinate. https://www.healthline.com/health/healthy-sleep/how-long-can-you-go-without-sleep