If all's well you can up and leave as soon as you want. And in public hospitals they're sometimes busy and will try and get you to leave within a few hours.
I was going to leave right away after DD, but then had PPH so stayed 2 nights. They wanted me to stay another, but it was christmas and they took pity on me. With DS I was private and ended up staying 6 nights, which was way too long in the end.