An example of greenhouse gases are carbon dioxide, methane and water vapour.
Infrared radiation from the Sun is only partly absorbed by the Earth. The rest is radiated into the atmosphere. Although some of the infrared radiation escapes, some is absorbed by greenhouse gases. This keeps the energy in the atmosphere, warming it up. This gradual warming of the atmosphere over many years is referred to as global warming.
The diagram gives more details about this process. It is called the greenhouse effect.