Perth has a relatively mild climate by Scottish standards, sheltered from the worst Atlantic weather by the surrounding hills. But "mild" is relative: expect rain at any time of year and cool temperatures even in summer.
Spring (April to June) is arguably the best time to visit. Branklyn Garden is at its most spectacular with Himalayan blue poppies and rhododendrons; Scone Palace grounds are open; the river is running well and the hills are green. Days are long and the light is excellent.
Summer (July to August) is the warmest period, with occasional days reaching 20°C or above. It's the busiest period for visitors but Perth doesn't get crowded in the way that Edinburgh or St Andrews does. The agricultural show season and Highland Games circuit are active.
Autumn (September to November) brings spectacular colour to the surrounding woodlands and the beech hedgerow at Meikleour. Quieter than summer and still comfortable for walking.
Winter (December to March) is cold and can be grey, but Perth is easier to deal with in winter than the Highlands. The city functions normally, accommodation is cheaper, and the Tay at flood can be dramatic from Smeaton's Bridge.