5 hours seems to be about the limit of programming one can do without making the next day improductive (at least in my experiece). Walking/running seems to help with that.
Normally though, time pressure or "get shit done" pressure gets the better of me, and my brain goes into turbo mode. After about 30 minutes of that, the rest of the day is more or less standby mode