After your surgery is done the doctors will give you a medicine to counteract the anesthesia they give you to put you to sleep.
When that medicine is given to you then you should begin waking up within about 5 to 10 minutes of the medicine being given to you.
So after surgery you should begin waking up 5 to 10 minutes after and while you're waking up the doctors in the hospital will move you from the surgery room to a recovery room.
In that recovery room the doctors will check on you and you'll begin waking up fully and sometimes you may wake up in the recovery room and not remember you were in the surgery room to begin with.
It can then take 8 hours or so before you become almost fully awake because you can still feel groggy for at least 24 hours after the surgery.
It can 24 hours for the anesthesia to fully get out of your system and for you to be fully awake and alert.