According to an article by Geoffrey Landis (http://www.geoffreylandis.com/moonair.html), oxygen and nitrogen are removed from the Moon within about 100 days, due to the combined effects of sunlight and the solar wind. However, if the atmosphere is thick enough, then this effect would no longer occur.* In this case, the gases would last for thousands of years.
A krypton or xenon atmosphere should last longer, but I can't find any numbers for that. Of course, this wouldn't be breathable, and those gases are also much rarer than oxygen or nitrogen.
Air wouldn't stay in a crater without a dome, it would diffuse out. Also, those permanently shadowed craters are extremely cold, precisely because of the lack of sunlight, so air in them would be unbreathable for this reason.
*: While not mentioned in the article, an artificial magnetosphere, like the one that has been proposed for terraforming Mars (https://www.extremetech.com/extreme/245369-nasa-proposes-building-artificial-magnetic-field-restore-mars-atmosphere), would presumably also work for this purpose.