How long?
Let your surgeon know you prefer to go home as soon as possible. And then after surgery, do your best getting fluids in and walking. Even if your doc typically keeps people in two nights, he may be willing to release you sooner if he knows you really want to go home as soon as you can and if you are doing well. I definitely think it's best to go home as soon as you are ready, because hospitals are full of nasty germs and you don't want to pick anything up. Even so, though, if you are having problems it's better to stay.
Please note: I AM NOT A DOCTOR. If you want medical advice, talk to your doctor. Whatever I post, there is probably some surgeon or other health care provider somewhere that disagrees with me. If you want to know what your surgeon thinks, then ask him or her. Check out my blog.