Roughly 75 hours. A week or two before returning to high school from summer break, a friend of mine and I decided to see how long we could stay awake. We made it through three nights, and fell asleep late in the morning of the fourth day. Delirium, confusion, light sensitivity, irritability, weakness, etc set in on the third day.
Otherwise, I had plenty of 36-40 hour days during my undergraduate engineering program. A never-ending litany of projects, homework, lab assignments, research papers, and studying for exams would require staying up all night and all the next day at least a handful of times each semester. I always found the nighttime hours the most difficult to stay up (and most depressing). Once the sun rises on your second day and you are up with everyone else, you just seem to go about your day normally, albeit very tired and groggy. And this was in the days before I started drinking coffee.
I think the latest I ever stayed up during law school was for 24 hours straight when completing a thesis-like research paper for a seminar class. That is what I get for doing nothing all semester and banging out a 50 page paper at the last minute (I got an "A").
In my post-education life, I have stayed up 24 hours straight to finish a project a few times in 5.5 years. Most recently I stayed up roughly 28 hours when we got up at 3:00 am eastern to catch a 5:00 am flight to Vegas. It was our first day ever in Las Vegas, so we stayed out very late sight seeing and partying it up till roughly 4:00 am pacific time. And that was running on only 3 hours of sleep.