As this recent article from the New York Times points out, the rehab facility (or hospital) is not the best place to recover from joint replacement surgery.
You want to get out of the hospital as soon as you are stable and get home where (1) you won’t be exposed to a lot of sick people and (2) you’ll have a lot of incentives to keep active and move around – there’s a lot more interesting stuff to do at home.
With modern anesthesia and pain management techniques requiring far less narcotics, people can go home faster feeling better than ever before. If you were living alone before your knee replacement,you should be able to go right back to that (with some pre-planning of course. Someone will have to walk the dog and do the shopping for a few weeks).
The majority of patients leave the hospital after a night or two. Some, with the proper support, can safely go home the same day. The key to great rehab is to get you back to your daily routine ASAP, and build on that.