The best time to visit Morocco are in spring (from mid-March to May) or fall (September to October). The weather is warm and nice, not too cold like winter with snow, or too hot like summer.
You can visit the coastline anytime. In winter, it’s comfortably mild, and in summer, the temperature stays around the mid-20°Cs.
The High Atlas Mountains are good to visit all year, but it gets cold in winter. Summer might be too hot for long hikes, but from April to October is generally okay. Outside these months, there’s snow on the mountaintops, which looks amazing but can be risky for hiking.
If you’re planning to visit during the Islamic festival of Ramadan, be aware that it can affect transportation. The dates change every year, so check them when planning your trip.

Morocco is always a good destination to visit the whole year a reason of it’s location between the Mediterranean and Sahara Desert. The only place you can avoid in the Middle of summer while visiting Morocco is Sahara Desert if you are not strong enough for the hot weather, specially, June, July and August. Morocco has many places to visit the whole year such as, coastlines, and Atlas Mountains.

The best time to visit Morocco if you are interested in Sahara Desert is from September to May, this time the weather is always mild, and the temperature is low.