Taiwan has a subtropical climate with significant variation between north and south, and between the west coast and the mountainous interior. The short version: autumn is the best time to visit; summer is the worst.
Spring (March–May) is pleasant — mild temperatures, cherry blossoms in the mountains, and the tea harvest season in the hills around Alishan and Nantou. Rain is possible but generally not heavy in the south and centre.
Summer (June–September) is hot, humid, and firmly within typhoon season. Temperatures in Taipei regularly exceed 35°C with high humidity. Typhoons can arrive with little warning and shut down transport, close hiking trails, and cause serious flooding. That said, plenty of people visit in summer and many typhoons miss the island entirely. If you're flexible with your plans, it can work out fine.
Autumn (October–November) is the prime season. Temperatures drop to comfortable levels, rainfall lessens, skies clear, and the island turns golden. October in particular is excellent for hiking, cycling, and travelling the east coast.
Winter (December–February) is mild in the south and can be chilly and grey in Taipei. It's the best season for hot springs — Beitou near Taipei and Jiaoxi near Yilan are popular choices. The east coast gets more sunshine than the north in winter. Chinese New Year (late January or February) is a major event but brings heavy domestic travel; book accommodation early if you want to be in a big city.