In Spain, peak temperatures (and sun intensity) occur between about 13:00 and 17:00. Elsewhere in the Northern Hemisphere, peak temperatures occur between 10:00 and 14:00.
Those who of us coming from outside Spain need to factor this into our daily plans. Personally, I recommend getting up just before first light, and starting to walk at sunrise, or shortly before.
If you get the free app, eltiempo.es+ these daylight times are provided for almost any named place in Spain, and most of Portugal too. In general, this means getting up at 06:00 and starting out by about 07:00. This works from April through September. Outside this date range, you may need to adjust the times a little.
Walking a pace of 4 km per hour, on average, gives you about 24 km of distance until 13:00. As noted above, this puts you at your destination just as the hottest time of the day arrives.
Of course, there are many variables that can affect this equation. Folks who walk longer distances may need more time. Those who walk slower will need more time. Hilly terrain will slow one down as well.
Hope this helps.