The world record for staying awake is around eleven days. People have been known to stay awake between eight and ten days in carefully monitored experiments. As you might expect, however, the longer they stayed awake, the harder it was for them to concentrate and engage in higher mental processes.
One question scientists grapple with when studying sleep is exactly how to define what it means to be awake. A long time without sleep can result in hallucinations and the loss of cognitive and motor functions. This is because our brains grab sleep automatically when we get tired enough.
Hallucinations are actually bits of dreaming and are part of brief episodes of sleeping known as microsleep. Microsleep, by the way, is one of the major unrecognized causes of auto accidents. However, if we don’t count these, there are no recorded cases of people dying due to sleep deprivation itself. Ultimately, scientists don’t know exactly how long humans can stay awake and how that affects the body.