The sun provides energy for almost everything that happens on Earth. Scientists at the Laboratory for Atmospheric and Space Physics put it clearly: "Solar radiation powers the complex and tightly coupled circulation dynamics, chemistry, and interactions among the atmosphere, oceans, ice, and land that maintain the terrestrial environment as humanity’s habitat." Put another way, just about everything that happens in the atmosphere happens because of solar energy. This can be demonstrated with some specific examples.
Sunlight hits the Earth most directly at and near the equator. The extra solar energy absorbed there heats up the air, land and water. Heat from the land and water gets sent back up into the air, heating it even more. The hot air rises. Something has to take its place, so cooler air from the north and south rushes in. That creates airflow -- a circuit from the equator up and splitting to the north and south, then cooling and falling back down to the surface and reversing direction to head toward the equator again. Add in effects of the Earth's rotation and you get trade winds -- the constant flow of air across the Earth's surface. Even though the winds are modified by the Earth's rotation, it's important to realize they aren't created by the Earth's rotation. Without solar energy there would be no trade winds or jet streams.
Some wavelengths of solar energy are powerful enough to split molecules apart. They do this by giving so much energy to an electron that it shoots right out of the molecule. That's a process called ionization, and the positively charged atoms that are left behind are called ions. In the upper atmosphere, 80 kilometers (50 miles) above the surface, oxygen molecules absorb ultraviolet wavelengths -- solar radiation wavelengths between 120 and 180 nanometers (billionths of a meter). Because sunlight creates ions at that altitude, that layer of the atmosphere is called the ionosphere. Sunlight affects the Earth's atmosphere, but a side-effect is that the atmosphere absorbs this dangerous ultraviolet radiation.
The Ozone Layer
About 25 kilometers (15 miles) above the surface the atmosphere is far denser than in the ionosphere. Here is the highest density of ozone molecules. Regular oxygen molecules are made from two oxygen atoms; ozone is made from three oxygen atoms. The ionosphere absorbs the 120- to 180-nanometer ultraviolet, the ozone beneath absorbs ultraviolet radiation from 180 to 340 nanometers. There's a natural balance because ultraviolet light splits an ozone molecule into a two-atom oxygen molecule and a single oxygen atom; but when a single atom crashes into another oxygen molecule, ultraviolet light helps them join together to make a new oxygen molecule. Again, a happy coincidence is that the photochemistry taking place at the ozone layer absorbs much ultraviolet radiation that would otherwise make it to Earth and create a hazard for living organisms.
Water and Weather
Another critical component of the atmosphere is water vapor. Water vapor carries heat more easily than gases, so the circulation of water vapor is of critical importance for weather. It's also of critical importance for life on Earth, as water from the oceans is heated by sunlight to rise into the atmosphere where winds blow it over the land. When the water cools, it returns to the surface as rain. The movement of storm fronts is largely the result of collisions between air masses with different water content. Every gust of wind, every storm you have ever seen, every tornado and hurricane was therefore driven by solar energy.