The weather in Marrakech is extreme. The best seasons for coming are early spring and late Fall. During the Summer season -- July and August -- temperatures can be well above the 113 Fahrenheit (45 Celsius) during most of the day (and, even worse, during the night).
If you come during the summer, bring a cap (if you have a sensitive skin, even an umbrella). Air conditioning is a must have. Even if you are a budget traveler, I recommend reserving a room with air conditioned.
It is also advisable to reserve ahead. The best hotels are usually fully booked. If you do not have a reservation you may find a place to sleep, but not in the hotel you want.