We were told 4 1/2 to 5 hours, but I think that was almost a maximum. I gave my son (35) and my daughter (13) a list of errands to run while I was in surgery, which lasted only 3 hours. Fortunately, they had ignored my instructions and were at the hospital. [Two weeks later they told my older daughter (31) they couldn't believe I was thinking of sending them to exchange my phone, etc., while I was having surgery. She said, "D'uh. She just did that to keep you busy so you would worry less." They had never figured it out.]
I was so glad they stayed! I woke with violent, uncontrolled spasms of my esophagus, which had in the past screwed up my heart on a GOOD day. It had to be treated fast, and there was no way with tubes still in and not able to talk that I could have explained it to the nurses. I asked for my kids, who were right by the door; all I got written was "esoph" before they told the nurse what was happening and I was medicated within seconds. Our hospital at pre-anesthesia gives us a brochure on having your advocate there at all times, and it paid off for me, in a way we didn't anticipate.
By the way, that pain I "brought with me" was the only really bad pain I had throughout the whole process. They don't want you to have pain, and they won't let you. It's scary to anticipate, but I found it much less painful and healing much faster than I anticipated.