https://www.faa.gov/pilots/training/...%2061-107A.pdf
Page 13 is the table of useful consciousness versus altitude, and is surrounded by a pretty good discussion.
Above 22k, note that the time to descend can be longer than the time to think. So a backup system and being willing and able to come down really fast need to be thought through beforehand.
RR is right, something happens in the 20's. Perhaps the partial pressure of O2 in the blood and air get close?