March and April are a gamble. You may get snow on the Kapuzinerberg or you may get shirtsleeve weather in the Mirabell Gardens, and there is no way to know in advance. What you do get is space: the Getreidegasse is walkable rather than shuffled through, and hotel rates sit near their annual floor.
By late May the calculation flips. The gardens are planted out, the Salzach runs full and glacial-green, and the Hellbrunn palace grounds with their trick fountains are open for the warm season, having typically closed over winter. This is the sweet spot before the crowds arrive.
The Salzburg Festival has run since 1920, and for roughly the last week of July through the end of August it is not an event in the city so much as the city itself. Jedermann is staged in the open air on Domplatz, black tie appears at six in the evening, and room rates climb into a different bracket entirely. Book months ahead or stay outside town.
Weather-wise, expect warm mornings and a real chance of a thunderstorm building over the mountains by late afternoon. Plan indoor hours, like the DomQuartier or the fortress, for around four o clock.