Malta has one of the most reliable climates in Europe — over 3,000 hours of sunshine a year, minimal rainfall between May and October, and mild winters. For Valletta specifically, the best months are April, May, October, and November: warm enough to be comfortable walking between sights, cool enough that the crowds are thinner and the limestone city doesn't radiate heat at you.
July and August are the peak season and can be very hot — 35°C in the city centre is not unusual. The streets are also at their most crowded, prices are highest, and the city can feel overwrought on cruise ship days when 5,000 visitors are added to the small peninsula. If you come in summer, start early and rest in the afternoon.
Winter (December to February) is mild by northern European standards — temperatures rarely fall below 10°C — and the city is genuinely quiet. Some smaller museums have reduced hours and a few restaurants close. The Carnival in February is worth timing a visit around: street parades, elaborate floats, and costumes in the tradition of the old Venetian-influenced Maltese festival.