Greenhouse gases (GHGs) are called so because, when the earth's atmosphere contains a higher concentration of GHGs, the effect is that the atmosphere keeps more of the sun's heat close to the surface of the earth, like the glass of a greenhouse. But when the earth's atmosphere contains a lower concentration of GHGs, the surface temperature of the earth drops slightly because less of the sun's heat is retained. Without some greenhouse effect, the earth would on average be about 33 degrees cooler than it is now (below freezing).
So a certain amount of greenhouse gas in the atmosphere helps keep the Earth's average temperature above freezing. The major naturally occurring greenhouse gases which do this are water vapour; carbon dioxide (CO2); methane (CH4); and ozone (O3).
Mostly, when we refer to GHGs we mean CO2 and, to a lesser extent, CH4, which is produced in smaller quantities than CO2 but is about twenty-one times more powerful as a greenhouse gas.