I had one knee replaced this January. Getting on a stationary bike was part of my physical therapy. It took 3 weeks before I had the range of motion needed to complete a full circle. After that, things improved more quickly.
I'm only riding my 11 speed Campy equipped LOOK on a trainer, as continuing therapy. I plan to get the other knee replaced in November. With my insurance maximum out of pocket expense met, the second knee should be almost free. Not sure if I'll ever resume road riding. The chances of damaging a knee are certainly good and so is the probability of just wearing out the mechanical joint. Getting a second replacement at some point is not uncommon, but after that, another is extremely difficult, perhaps impossible.