Without food and water: 18 days.
In 1979, Andreas Mihavecz — then 18 — was left, forgotten, in a basement prison cell until he was accidentally discovered 18 days later. This was not a stunt, but an act of negligence on the authorities' part. It took Mihavecz several weeks to recover.
Why you shouldn't try this at home: Of the two, water is more critical to replenish than food. An adult is made up of about 60% water, using it to lubricate joints, flush waste, and regulate body temperature.