Volcanoes affect global climate by putting carbon dioxide and aerosols into the atmosphere. Carbon dioxide is a greenhouse gas and has a slight warming effect. However, this contribution is small and total annual volcanic CO2 emissions are equal to about 5 days of human emissions. The aerosols have two main effects: acid rain and cooling temperatures. The acid rain effect is usually fairly local or regional, but large eruptions can cause temperatures to drop on a global scale. This is because the aerosols from the eruptions reflect some of the incoming radiation from the sun and prevent it from reaching the Earth’s surface for a few years after the event. Eruptions large enough to affect global temperatures happen a few times per decade; a large eruption in 1991 dropped global temperatures by nearly a full degree Fahrenheit!
Extremely large events can have even larger effects, but are extremely rare. The last “super-volcano” was over 70,000 years ago, but the cooling effects may have lasted 1000 years. Even this is not the limit though: periods of extreme volcanic activity called Large Igneous Provinces (LIPs) occur maybe once every several hundred million years, but can cause global mass extinctions and plunge the world into extended winters that last years.