Graz is at its best in spring and early autumn — May through June, and September through October — when the weather is warm without being oppressive and the outdoor spaces around Hauptplatz and the Schlossberg are genuinely pleasant. Summer (July–August) can be hot and humid, though the city is less overrun with tourists than Vienna or Salzburg.
Winter is worth considering if you can handle the cold. The Christmas market on Hauptplatz is one of the better ones in Austria — less commercial than Vienna's, with a strong emphasis on Styrian food and craft. The Advent season runs from late November through Christmas Eve. The Schlossberg in snow is a particular sight.
The grape harvest season (September–October) is the best time to explore the wine country south of the city — the Südsteiermark region produces some of Austria's finest whites, and many wineries are open to visitors during harvest.