Considering its location, Iran has unusually diverse weather.
The north is very hot in summer, cold in winter, with the bulk of rain coming in spring and late autumn. In the south you’re in the Persian Gulf, so expect pretty warm days even in December and January, followed by a pleasant spring and a very hot summer.
If you’re in the mountains, then of course expect mountain conditions – unpredictable, sometimes hot, sometimes cold. Broadly speaking the best times of year to visit are in spring and autumn.