Map from Google - Malaga

In Málaga, city on the coast of Andalusia, in southern Spain, the climate is Mediterranean, with relatively mild and rainy winters, and hot, sunny summers. The average January temperature is 12 °C (53.5 °F), that of August is 25.5 °C (78 °F).
Here are the average temperatures.
Average temperatures - Málaga
Min (°C)78910131720211814118
Max (°C)171819212427303028242017
Min (°F)454648505563687064575246
Max (°F)636466707581868682756863

Precipitation is not abundant, since it amounts to 525 millimetres (20.5 inches) per year, and follows a Mediterranean pattern, in fact it mostly occurs from October to March, while in summer it almost never rains. The rainiest month is November.
Here is the average precipitation.
Average precipitation - Málaga
Prec. (mm)8055504025122615559590526
Prec. (in)

The wind blows frequently: in the cold half of the year it comes together with Atlantic depressions, while in summer it blows in the form of afternoon breeze.

Winter, from December to February, is mild, and is characterized by sunny periods, alternating with periods of bad weather, with wind and rain. Very cold days are rare: only on colder nights the temperature can drop to the freezing point, but even in these cases, usually the daytime temperature rises above 10 °C (50 °F). In practice, it never snows nor freezes. In January 1985, cold in much of Europe, the night temperature dropped once below freezing, up to -3 °C (27 °F).

Spring, from March to May, is mild and sunny, with rainy days still possible, but not so frequent. In May, and sometimes in April, the first hot days occur, with highs around 30 °C (86 °F).

Summer, from June to mid-September, is hot and sunny. Typically the temperatures hovers about 27/28 °C (81/82 °F) in June and September, and 30 °C (86 °F) in July and August, and the air is humid, but sea breezes blow, in short, the typical Mediterranean summer. But when the wind blows from the interior of Andalusia, the heat can be torrid, and the temperature can reach 35/37 °C (95/99 °F), and sometimes even 40 °C (104 °F); fortunately in this cases the wind is lively and the air becomes drier: it is advisable to drink often, to avoid dehydration.

Autumn, from mid-September to November, is initially warm, and then becomes gradually milder, and periods of bad weather become gradually more frequent. Even in October there are many warm, sunny days, especially in the first half. In November we are by now in the middle of autumn, with a mild climate, though cloudy and rainy. Sometimes the rains may be concentrated in a short time and be heavy.

The amount of sunshine in Málaga is very good in summer, when clear skies prevail, is good in spring, when cloudy periods are sometimes possible, while it is decent in autumn and winter, when in addition to sunny periods, cloudy and rainy days occur with some frequency.

Malaga, view

For swimming, the Alboran Sea is never very warm, given the infiltration of water from the Atlantic Ocean: it's still very cool in June, when the temperature is about 20 °C (68 °F), then it reaches 22 °C (72 °F) in July and September, and 23 °C (73 °F) in August, when it's acceptable for swimming.
Here are the average sea temperatures.
Sea temperature - Málaga
Sea (°C)161515161720222322201816
Sea (°F)615959616368727372686461

When to go

The best time to visit Málaga, for walks and hikes, is spring, in April and May; you can also choose the beginning of autumn, from mid-September to mid-October, although sometimes there may be quite intense rains.
For the sun and the sea, in Malaga and Costa del Sol, the best time is instead the summer, from June to mid-September. It's better to bring a sweatshirt for cool and windy evenings, especially in the first part of June.