Map from Google - Mexico_City

In Mexico City, the huge federal capital of Mexico, the climate is subtropical, mild or pleasantly warm during the day, with cool nights in summer and cold nights in winter. In fact, the daily temperature range is remarkable, especially in the dry season.
The city is located at a tropical latitude, but at an altitude varying between 2,200 and 2,600 metres (7,200 and 8,500 ft), in the so-called tierras frìas.
Here are the average temperatures.
Average temperatures - Mexico City
Mexico CityJanFebMarAprMayJunJulAugSepOctNovDec
Mexico CityJFMAMJJASOND
Min (°C)6791112121212121087
Max (°C)212326272725232322222221
Min (°F)434548525454545454504645
Max (°F)707379818177737372727270

Rainfall is concentrated in the summer months: it exceeds 100 millimetres (4 inches) per month from June to September, it's moderate in May and October, and scarce in the other months. Typically the rains occur in the form of showers in the afternoon or evening, and when they are abundant they can make it difficult getting around. The dry season is long, going from November to April. The total annual rainfall is around 550/650 mm (21/25 in) per year in the eastern districts, while it increases in the western districts, up to 1,000 mm (40 in) per year in the neighbourhood called Bosques de las Lomas, which is located at the foot of mountains, more than 3,000 metres (9,800 ft) high and able to enhance the summer rains.
Here is the average precipitation.
Average precipitation - Mexico City
Mexico CityJanFebMarAprMayJunJulAugSepOctNovDecYear
Mexico CityJFMAMJJASONDY
Prec. (mm)10510255511016015012045155710
Prec. (in)0.40.20.412.24.36.35.94.71.80.60.228
Days1234111317171572294

The amount of sunshine is never good, because the weather can remain variable or cloudy even during the dry winter period, however, it's acceptable in winter and spring, before the summer rains, while cloudiness is frequent and widespread in summer. The pall of pollution that hangs over the city makes the sky often veiled and the air hazy. Anyway, because the city is located at high altitudes, its tropical sun is very strong, especially when it is highest above the horizon around noon, ie from April to August.

In winter, from November to February, it's cold at night, while daytime temperatures are pleasant. In the city the "urban heat island effect" reduces the overnight cooling, but in the countryside and in the less urbanized neighbourhoods the temperature can get to the freezing point (0 °C or 32 °F). Already in February the daytime temperatures begin to rise, often exceeding 25 °C (77 °F). It hardly ever rains. Sometimes there can be wind days, which have the advantage of cleaning the air.

Spring is the warmest season, at least during the day, thanks to the higher amount of sunshine. In April and May the temperature often touches 30 °C (86 °F); at night, however, it can still be a bit cold. In May, the first rains begin.

Summer, from June to September, is the wettest season: rain showers occur almost daily, although they are rarely abundant. The weather is mild, and the temperature range is reduced compared with the previous months: the daytime temperatures are virtually the same as in winter, while at night they are cool but not cold.

Autumn is short: in October, a month still quite mild, the last rains occur, while in November actually it's already winter, and nights become cold again.

Mexico City

When to go

The best time to visit Mexico City runs from November to April, being the dry season. Within this period, we can make some distinctions: in winter from November to February, and sometimes in March, cold nights are more frequent, with lows around freezing; from February to April it's the sunniest period, and daytime temperatures are a bit higher, especially in March and April. All in all the best months are March and April. Due to the remarkable temperature range between night and day, in the dry season it's better to dress in layers, with warm clothes for the evening, and light for the day. Also sunscreen, hat and sunglasses can be useful.
Even May and October can be taken into account: the rains are quite frequent, but less than at the height of the rainy season, and there is the advantage that nights are less cold.