Summer in Madrid is hot and dry—expect the averages around +31°C or even up to +40°C. Usually during the day the city "dies out." This is the time for the afternoon siesta. The usual pressure of urban traffic is less tense in unbearably hot July and August, as locals try to go to the Mediterranean resorts.
In the evening, after the midday heat, the city cools down a bit and comes back to life: cafes, restaurants, and nightclubs are full of people. You will need an air conditioner or, at least, a powerful fan to survive the summer in Madrid.