After a knee replacement, our advice is to exercise more than you have in years. Focus on total body muscle building and weight optimization. You can likely return to most sports when you are fit enough to protect your joints.
When it comes to total joint replacements, traditional advice is: Wait for your knee pain to get unbearable. Wait until you are old enough for a total joint replacement. And, once you have the total joint replacement: Don't exercise too much. Don't run. The fear was that the joint replacement would come loose or wear out. 
Current advice at our clinic: Every year is precious. Where possible, use biologic knee replacement procedures to rebuild the knee naturally, such as articular cartilage paste grafting combined with meniscus replacement. If you have bone on bone disease, past the point where biologic replacement techniques can work, then replace the affected area with artificial components. Only replace the part that is worn out, usually with a robotic partial knee replacement.
Only if a knee is worn out on all sides of the joint do we use a full knee replacement, though we do not usually replace the patella.
After your knee replacement, our advice is to exercise more than you have in years. Focus on total body muscle building and weight optimization. You can likely return to most sports when you are fit enough to protect your joints.
Why? The cause of artificial joint replacement failures, in the absence of infection, is most commonly the loosening of the cement from the bone interface and the wearing out of the plastic inserts.  In our opinion, much of the loosening is due to the weakening of the bone, osteoporosis as the patients' age.  The only known effective way to build bone is by resistance exercise.  So by increasing your weight lifting, cycling, skiing, and hiking, you are decreasing the chance of the component loosening. It's possible that the advice to limit activities actually increases the number of failures. 
Additionally, the stronger the muscles the less force goes through the joint, as muscle absorbs force, guides more normal mechanics and protects the joint. Increasing weight lifting increases muscle size more than any other activity. 
The wearing out of plastic components most often occurs in mal position or mal tracking of the joint. Improved tracking is facilitated by strong muscles, better balance and more normal gait, all of which come from a strong core and strong trunk muscles. Total body fitness conditioning is the key to a long lasting joint replacement. Most modern knee replacements have plastic components that are interchangeable if worn out.  So why limit an entire later lifetime of sports by the fear of them wearing out?
Finally to running: Running is the most common request we get from our athletes who need total knees. The data is that whether you run a mile or walk a mile, the total force on the joint is the same, since you take fewer steps when running.  The peak forces are higher depending on the type of surface, the smoothness of the gait, the shoe wear and other factors. If you must run, run with great form on soft surfaces with new absorbent shoes. I have never seen a total knee become worn out from running nor have any of my peers who I have asked. In general cycling is a more logical sport as it limits the impact, but logic is not the reason we run.
To sum up, if you've been told you need a total knee replacement, first check the options and make sure you really do need one. If you end up getting a total knee replacement, it's not the end of your active life by any means. Get back to your exercise, work on building muscle and enjoy your freedom to move.
1. Kuster, M. S., Spalinger, E. S. T. H. E. R., Blanksby, B. A., & Gächter, A. N. D. R. É. (2000). Endurance sports after total knee replacement: a biomechanical investigation. Medicine and science in sports and exercise, 32(4), 721-724.
2. Naudie, D. D., Ammeen, D. J., Engh, G. A., & Rorabeck, C. H. (2007). Wear and osteolysis around total knee arthroplasty. Journal of the American Academy of Orthopaedic Surgeons, 15(1), 53-64.
3. Chang, M. J., Lim, H., Lee, N. R., & Moon, Y. W. (2014). Diagnosis, Causes and Treatments of Instability Following Total Knee Arthroplasty. Knee surgery & related research, 26(2), 61-67.
4. Layne, J. E., & Nelson, M. E. (1999). The effects of progressive resistance training on bone density: a review. Medicine and science in sports and exercise, 31(1), 25-30.
6. Ostrowski, K. J., Wilson, G. J., Weatherby, R., Murphy, P. W., & Lyttle, A. D. (1997). The Effect of Weight Training Volume on Hormonal Output and Muscular Size and Function. The Journal of Strength & Conditioning Research, 11(3), 148-154.
7. Dixon, M. C., Brown, R. R., Parsch, D., & Scott, R. D. (2005). Modular fixed-bearing total knee arthroplasty with retention of the posterior cruciate ligament. The Journal of Bone & Joint Surgery, 87(3), 598-603.
8. Farris, D. J., & Sawicki, G. S. (2011). The mechanics and energetics of human walking and running: a joint level perspective. Journal of The Royal Society Interface, rsif20110182.