With plenty of sunshine, any time is a good one to visit Morocco. However, depending on where you go in the country, and when, you can expect to find substantial variations in climate.
Morocco has a Mediterranean climate in the north and a desert climate in the south. In general, it rarely rains in Morocco, and then primarily in the winter months. It also tends to rain slightly more in the north of the country than in the south, although this variation is subtle. Peak travel times to the whole country are in the Spring and Fall, when the country is at its most temperate and abundant.
Broadly speaking, there are four climatological “zones” in Morocco – the coast, the mountains, the desert, and the country’s interior.
Along the coast of Morocco the weather is typically very mild. In the north, you can occasionally cool and mildly wet undertones – somewhat similar to that of San Francisco. Temperatures in a city like Tangier range from the 50’s in the winter months to the high 70’s in the summer. The rest of the Atlantic coast all the way through places like Essaouira are extremely pleasant all year round.
As with any large mountain range, it can get extremely cold in the Atlas, Anti-Altas and Rif mountains, particularly in winter, when it can plummet to sub-zero temperatues. Snows have been known to block some of the roads during these months. Regardless of what time of year you go, if you want to spend time in the mountains, bring plenty of warm clothing.
The oases and hammada leading out to the great Sahara can become extremely hot during the day, and absolutely chilly during the night. (This is because a lack of moisture in the air does not allow it to hold any heat.) Here, full summer gear and long underwear can sometimes be invaluable on the same day!
Finally, the interior of the country, and Marrakech in particular, can become extremely hot, especially in the height of the summer, with cool evenings.