RickF said:+1 for listening to the surgeon. Depending on which vertebrae, the extent of the damage, and the operation performed, it could be as little as two weeks or as long as 16 weeks. Also, it would depend on the type of riding and the position on the bike.
Cycling and swimming can also mean a lot of different things to different people. It would not be a good idea to swim butterfly or ride in an aero position too soon after surgery. Riding on a trainer in an upright position or swimming breaststroke or backstroke at a leisurly pace could start sooner than other types of cycling or swimming.
Take your time. It took me a good 4-5 months to get back on the bike, and a full year before I was able to ride anything longer than 4-5 miles. I'm now doing 50, so it's possible to improve to a strong level, but there's no rush. You don't want to deal with setbacks during the recovery. Besides starting slowly (to quote Covert Bailey - "start so slowly that people make fun of you".), the other advice is to cross-train. I never run or ride two days in a row. It's always mixed with other activities.....
(2004 - Fractured L2 vertebrae in a motorcycle accident - spinal fusion T12-L3. Was initially partially paralyzed in my right leg, but due to a good surgeon, kick-a** therapist, and a lot of hard work, I'm doing pretty darn well, thank you.)