Based on my father's experience, you are typically in the hospital for about a week or 2 since your prostate needs to recover from what they do to your prostate.
It depends on the type of cancer and the type of surgery. After a radical prostatectomy for prostate cancer, typically the patient is admitted on the day of surgery and goes home the next day.