The desert climate at Merzouga means extreme heat in summer (June to August), when temperatures regularly exceed 45°C and the village is nearly deserted. This is not a time to visit unless you specifically want solitude and don't mind the heat.
The best months are October to April. Spring and autumn — September to November and March to April — are ideal: warm days, cool nights, and manageable crowds. October and March are particularly good. Winter (December to February) can be cold at night, occasionally very cold (below zero in the dunes), but daytime temperatures are comfortable and the light is excellent. This is also when Dayet Srji is most likely to have water and flamingos.
The camel trek overnight requires warm layers even in shoulder season: desert temperatures drop sharply after sunset and the predawn hour before sunrise can be genuinely cold. The summer months, if you must go, are best done at altitude — the Dadès and Ziz valleys to the north are significantly cooler.