Standard thermonuclear weapons have a fallout that will typically degrade to habitable levels within 6-18 months.
A ground detonation would produce a more severely affected local area of irradiation whereas an air burst would ultimately cover such a broad area that it would be diffused and relatively harmless.
After an atomic explosion the fallout is entirely airborne particulate and is more easily blown away or swiftly incorporated into the water cycle and dispersed compared to a nuclear meltdown.
Of great concern, should one ever be built or detonated, is a Cobalt Bomb. This is a kind of "salted" nuclear weapon where a large amount of cobalt is added to the device and the reaction turns it into the highly radioactive cobalt-60. This would produce levels of radiation that are overall less than a standard weapon but render an area completely uninhabitable for up to 5-10 years.
A Cobalt bomb could produce the kind of post apocalyptic wasteland we've come to expect from popular culture.