How do 'greenhouse gases' let heat in, but not let it out?
In a nutshell:

The radiation that enters is shortwave radiation from the sun.  Solar radiation is dominated by visible (as well as UV and near infrared) radiation with a wavelength mostly between 0.2 µm and 2 µm.  This wavelength is determined by the temperature of the Sun, in the order of 6000 K.  For visible radiation (roughly between 0.4 µm and 0.7 µm), all the gases in the atmosphere are (almost completely) transparent.  Clouds do scatter this radiation so you can't see the Sun directly when it's cloudy, but they still let plenty of light through, so it's still light on a cloudy day (just less bright), although it does feel cooler.

The radiation that leaves is longwave radiation, also known as terrestrial radiation or (incorrectly) as thermal radiation.  For Earth, this is dominated by radiation with a wavelength of mostly between 4 µm and 40 µm.  This wavelength is determined by the temperature of the Earth, at around 290 K.  At these wavelengths, greenhouse gases are mostly opaque.  They absorb the radiation.  The greenhouse gases reradiate the absorbed heat, but in both directions (back to Earth AND up to higher layers in the atmosphere), and at a lower temperature.  The upward longwave radiation gets in turn absorbed by higher-up layers of greenhouse gases, et cetera, such that ultimately the layers of greenhouse gases that do radiate into space tend to be high up in the air (say at 240 K).  Thus, their overall effect is to radiate less heat into space than the Earth surface would in the absence of those gases.

The most important greenhouse gases are water vapour, carbon dioxide, and methane.


Source: gisgeography.com  


Source: science of doom