For both hiking and cycling the best time is spring (March to June) and autumn (September to November), although winter can also be very nice if you come prepared (it gets dark around 18 and nights can be cold in the mountains, but generally nice sunny weather during the day).
Andalusia is Spain’s warmest region. It has average yearly temperatures of 17ºC, around 600mm of rainfall and some 3,000 hours of sunshine, with long, hot summers and short, mild winters. But of course it depends at what altitude you are cycling or hiking…Sierra Nevada for example has a truly high-mountain climate. See also our blog