For some surgeries they do no remove your hospital gown in the operating room once you're put to sleep.
When you're given anesthesia and put under then the surgical team will remove your gown in the operating room and leave you completely naked for some procedures.
However sometimes for some less invasive surgical procedures they may only partially remove your hospital gown.
I once went in for some surgery for my heart and they did remove my hospital gown completely.
However when I was in the hospital room recovering I had my gown back on.
So they should put a new hospital gown back on you before you wake up.
However I've heard of some people go in for surgery have their hospital gown removed and then they woke up completely naked.