Any surgery has risks and the bigger the surgery, the more the risk. A knee replacement is a fairly routine surgery for orthopedic surgeons, but it’s still a major surgery.
Most of the possible complications are the same for just about any other surgery: infection, blood clots in the legs, and pneumonia (if you can’t get up and about, and can’t do the deep breathing exercises after having a general anesthetic). Complications specific to the replacement is loosening of the prosthesis, weakness or breakdown of the bone around the replacement, and stiffness in the knee.