Everyone goes to Ricks, or so the movie “Casablanca” suggests anyway. And while Rick may have been comfortable with his suits and tuxedos chances are they’d be a little warm for the North African Sahara desert, especially in the summer.
To many it might even seem that it is always summer in deserts of Morocco, and they wouldn’t be entirely wrong. But the area does have actual season, and in the winter things can actually get downright chilly. And depending on where you’re at you might experience dry but chilly weather or the wet and cool rainy season from November through April. During this time the day time temperatures are in the upper 50s to mid 60s, and as low as the high 30s at night. Being in the desert it can really cool off fast after the sun goes down. And in the mountains temperatures can fall below zero, and many peaks are snow capped throughout the year. Across the country late winter and early spring is generally the wettest time of the year, and by summer there is almost no rainfall to speak of.
The late spring and early fall can be generally mild with temperatures in the 80s. By the summer it can be extremely hot and dry, especially to the south. It isn’t uncommon for daytime temperatures to climb to 100 or more. This makes for a good time to hit the beach and cool off in the ocean!
It might be worthwhile to note, that the weather during autumn upto November,  tends to be more settled, compared to springtime, at least in the south. Be prepared for various weather conditions, damp and often windy at the Atlantic coast, dry and warmer inland.
In the city...Marrakech is scorching from June until end of September and being unable to do much between the hours of 11am and 6pm can really hamper your enjoyment of the city, especially if travelling with children. Remember too, that it is respectful and appropriate to cover your shoulders and knees, both men and women so this makes it even harder stay cool. If you intend to travel around Morocco the supratour buses are usually air conditioned whereas the trains are not. The best time of year to be in Marrakech is May/October  but whenever you go take lots of sunscreen and a hat!