I have been up for 7 days in a row from opiate withdrawal before, I tried to sleep so hard, but just can't during withdrawal. I laid down at night every night so my body still got some rest. I eventually caved and relapsed because thre lack of sleep made it absolutely unbearable.
Without drugs I can go 2 days easily, but choose not to because sleep is good for you. With drugs, a few days, but I avoid this because it's horrible for you. I fairly often will take drugs after my band plays a show, if we're at a festival or something, and stay up for 2 days and sleep the next night. The day after no sleep I experience a loose, jovial mood, if it is not done too often, and I like it a lot. When I was younger I would do it for fun and pretty often, but nowadays (at almost 40 years old) I feel the ramifications for days afterwards and it's not great, so I try to avoid it. I do pretty often only get a few hours of sleep for a night, or even get average 4 hours for a week here and there. I've always needed less sleep than most, my mom says even as a baby I slept a lot less than my siblings did at each age. 6 hours of sleep is my ideal, it seems that my sleep cycle is about 3 hours, maybe a little more. If I get 8 hours of sleep I feel less good than if I get 6 or 7. But less than 6 and it feels like I should have gotten more.
The longest I have stayed up with drugs was 7 days, I was binging desoxypipradrol. I was getting some hallucinations by the end, a little, but I was surprisingly lucid and never went psychotic. I did lay down and watch the pictures behind my eyelids for at least a couple of hours each night but for sure did not actually sleep. I ran out on the 6th day which is why I slept the 7th.
I'm sure if I was binging on stims and tried to stay up longer I could. But lack of sleep is horrible for you so I am not planning to try.