Map from Google - Marrakesh

In Marrakech, the charming imperial city of Morocco, the climate is subtropical semi-desert, with mild winters and hot summers. Rainfall is scarce, since it amounts to 10 inches per year, and occurs from October to May, while from June to September it almost never rains. The rains, albeit rare, occur in the form of downpour or thunderstorm, and occasionally can be intense.
Here is the average precipitation.
Average precipitation - Marrakesh
Prec. (in)

The city is located at 1,500 feet above sea level, an altitude sufficient to lower a bit the nighttime temperatures; on the other hand the distance from the sea makes remarkable the temperature fluctuations between night and day.
The southerly winds descend from the High Atlas Mountains, whose highest point is Jebel Toubkal, 13,671 feet high, bringing sudden temperature increases. The wind can lift sand and desert dust, reducing visibility.
Here are the average temperatures.
Average temperatures - Marrakesh
Min (°F)434648525761686864595045
Max (°F)646872758188979790817266

Winter, from December to February, is mild in the daytime, but at night it can get cold: the temperature drops quite often below 41 °F, and sometimes to the freezing point. There are several sunny periods, alternating with periods of cloudy and rainy weather. Towards the horizon you can see the spectacular peaks of the Atlas Mountains, which are often snow-capped.
When the wind blows from the south, the temperature can approach 85 °F even in winter.

Marrakech, Atlas snow-capped peaks in the background

Spring, from March to mid-June, is pleasantly warm, and the rains become increasingly rarer. At night it can still get cold in March and sometimes in April, while the south wind can cause the first hot days: the temperature can touch 95 °F in March and April, and 105 °F in May.

Summer, from mid-June to mid-September, is very hot, dry and sunny. The temperatures vary according to the period: in some days they are acceptable, so that highs are slightly above 85 °F, and lows can drop to about 59/63 °F, which means that at night it can even get a little cool; this happens especially in June and September. Other periods are decidedly torrid, so that the maximum temperature can exceed 113 °F for several consecutive days; this happens especially in July and August, which stand out as the warmest months. In the hot summer of 2012 the temperature have reached 116.5 °F at the end of June, 121 °F in July and 119.5 °F in August.

In Autumn, from mid-September to November, the temperature gradually decreases. In October hot days are still possible, with highs about 95/100 °F, but generally the temperature is acceptable, warm during the day and cool at night. In the meantime the first rains occur, which become more frequent in November.

The amount of sunshine in Marrakech is good all year round, but especially in summer, when clear skies predominate.


When to go

The best times to visit Marrakech are spring and autumn, especially in March and April and from late September to mid-November: in this way you can avoid the heat, at least that with 105 °F and above, however, you must put into account some rain, and a little cold at night, especially in March and November. In May and early June, the temperatures are often acceptable, but you can not rule out some hot days.
After all, even the winter is not bad, although you must be equipped for the cold at night, and take into account some rainy days.