You will need to sit down and talk with your orthopedic surgeon
prior to the surgery
in order to get a better sense of your recovery time. Recovery time after knee replacement surgery depends a lot on your other medical issues - such as your weight, your level of physical fitness, and whether you have any other major medical problems such as diabetes.
Generally speaking, however, for most people the recovery from knee surgery takes a few months. Immediately after surgery, while still in the hospital, you will begin working with physical therapy. The first major hurdle is to determine whether you can get around well enough with a walker or cane to make it home or not. If not, you may spend a few days or weeks in a rehabilitation facility.
Following this, you will gradually progress to a cane and then to walking independently. This often takes several weeks to a month or two. You will likely not be able to drive until you are able to walk independently without a cane or walker. If you are still working, returning to work will depend a lot on how demanding your job is, but similarly will probably be several weeks to a month or two.
Talk to your orthopedic surgeon for more information!