First, where did the name come from? Well a greenhouse usually was a building consisting of a lot of glass to let the sunlight through, and other materials. The book Heat Transfer by JP Holman tells us that ordinary window glass transmits radiation up to about 2.5 microns (the energy goes through the glass if its wavelength is less than about 2.5 microns).
Now the question is: How much solar energy has wavelength of less than 2.5 microns?
The answer is 'about 97% of solar energy if we use a blackbody approximation for the sun and ignore wavelengths attenuated in passing through the atmosphere, etc.' So about 97% of the solar energy passes through the glass and is absorbed by ground and so on.
Now how much of this energy escapes? Well if the absorber heats up to 50 deg C, then radiation from it that is above 2.5 microns will not escape. The answer is that far less than 1% of this radiation can escape through the glass, using a blackbody approximation. The reason is that the energy of wavelengths greater than 2.5 microns radiated from a black body at 50 deg C is more than 99% of the total. So light, ultraviolet and infrared all heat up objects when absorbed by the objects. The objects then radiate heat, but mostly of a lower frequency than that of solar energy. This energy does not go through the greenhouse glass back to the outside. The atmosphere acts in a similar way - the sun shines through it, the sunlight is absorbed by bodies, the bodies radiate heat of a frequency that does not easily pass through the atmosphere. So heat comes in and cannot get out so easily. There is, however, the “atmospheric window” allowing energy of wavelengths of 8 to 14 microns approximately to pass out to space.