It’s actually both what Damien and Les said. The uneven heating of the atmosphere causes changes in the density of the air. There are all manners of how this actually creates wind.
In coastal areas, for instance, since land heats and cools much faster than water, you get sea and shore breezes. When the sun comes up, the land heats up much faster than the sea, which, in turn, heats the air over the land much faster than the air over the sea. As the air heats, it becomes less dense, which means that it rises. As this heated air rises, the pressure at ground level is lowered. The differential between the lower pressure over land and the higher pressure over water causes air to be “sucked” onto shore. This is a sea breeze.
When the sun goes down, the land cools much faster than the water, and the opposite happens. This is a shore breeze.