From San Pedro to Ronda on the A-397 it's about 45kms, the first 22ish see the road rise 1065metres fairly evenly, after that 10ish of gentle climbing then downhill to Ronda.
I cycled up to the 1065metre sign (22kms) 17 times last year on my touring bike but without a load. Take your time with a load & you should be OK, with the usual plenty of fluid, etc.
An alternative route is to go Monda, Guaro, Alozaina, Yunquera & El Burgo, a little easier to climb (not much), but quite a bit further.
The Ronda road is spectacular, great views, depending on the time of day it can have a lot of traffic, but drivers are well use to cyclist being on it, it's a favorite training run for Roadies.
(At risk of stating the obvious, but it's very hot here right now). My top tip would be to start very early - 7ish. And if you can't get there be lunchtime take a long lunch break and finish off after 6 pm.
Ive done this road too. The guys have perfectly summed it up. Ronda is do-able as a day trip from Marbella. And a nice trip it is too. Ronda is a great finishing place, get some nice lunch enjoy the views, then cycle back (which is a lot easier).
Only tip i would say, is that depending on the time of year, Ronda experiences very different temperatures to Marbella due to its altitude. In the summer, you could find Ronda a lot hotter, and in the winter you could find it a lot colder. Also be aware that at night time the temperature can drop.
I wizzed down the ronda road, totally unprepared and couldnt feel my fingers anymore as i was nearing the bottom and was shivering with cold. So pack some warm clothing just in case.