Nature of injury and time off bike
I had knee surgery at 31. I had already been off the bike and most other activities for 3 months trying to let it heal naturally plus we'd just gone through winter. Was in a velcro cast for only 5 days but that was enough for the muscles to atrophy a lot and the tendons and ligaments to stiffen up significantly. Because the joint was stiff as a board, just getting on the bike was impossible after removing the cast. It took weeks just to get full mobility back.
At 36, I had a hysterectomy, bikini cut, during the summer. I had a good base prior to surgery so healing time was about 4 weeks. I took 6 even though my doctor was ready to release me. I was back on the bike the day he released me and back to form a few weeks later.
A lot depends on prior conditioning, injury, and time off bike. People of all ages race. Go get 'em, Hon!