However obvious it might seem that you're replying to the OP, it always helps if you reply to the OP, not to the closest post to hand...
Look at my post, for example - I've clearly clicked "Quick Reply" to your post, not D3V's, or Spector's.
---
The most I've done before is ~75 hours: fifteen hour day, then I started working on an assignment, which I finished in one sixty hour sitting. I think I started hallucinating around the fifty hour mark - whenever I looked over to my curtains, or things hung up on the door, they looked like they were swaying and reaching out to me.
It's quite interesting looking back at my code, as I can clearly see different stages of sleep deprivation - a good portion of it is well-written code which I hammered out pretty quickly. When I get to the debugging and solving of problems, things start to turn weird - variable names that are obvious typos, really long, roundabout ways of doing things and magnificent hacks to get it working, rather than fixed.
It's strange, though. Whenever I do an all-nighter to get an assignment finished, my best work always happens between 3:00 and 4:30. What's even stranger is that, when I was doing the aforementioned assignment, it happened each night!
But yeah, generally my ability to type and think clearly go after about twenty-two hours of being awake, though I get odd bouts of genius. At least, they feel like genius a the time.
As for documented studies, I can't think of any, but there are a few interesting blog entries from people around the Internet who have tried adopting the Dymaxion or Uberman sleeping patterns. Give them a Google. I think I first came across them on Lifehacker.