As mentioned above, any blackbody (perfectly efficient radiation absorber) above absolute zero radiates a particular EM spectrum which is predictable with quantum mechanics. Most objects are sufficiently close to blackbody we can use that theory for real objects.
The exact spectrum depends on its temperature, and only temperature. In objects below about 1000K, the peak of the emitted spectrum is in the infrared. For really cold objects, like the cosmic background, the peak is all the way into microwave.
When the object gets above 1000K, enough radiation is emitted at visible wavelengths that it starts glowing red. It was always glowing, just not enough of it was in the visible range to be seen. As it gets hotter still, the object goes through orange, yellow, and then white, at around 5500K. At this temperature, the peak of the radiation spectrum is near green, but the spectrum is spread out such that our eyes receive basically equal signals from all visible wavelengths, and thus the object appears white. This is why there are no green stars.
As an object gets even hotter, the peak leaves the visible range headed towards ultraviolet, and even x-rays and gamma rays for some astronomical objects. Some light is always still emitted in the visible range, but they cover the spectrum such that they appear blue.
The sun is effectively a blackbody at around 5500K, and emits something like 90% of its radiation in the visible range. (It seems reasonable that the visible range is what it is precisely due to this fact. For critters around other colored stars, the visible range is probably different.) So, almost all the heating of the earth is actually performed by visible light, not infrared.
A room-temperature object, such as the surface of the Earth, does emit infrared. The atmosphere is not as transparent to infrared, due mostly to water vapor with some contribution by carbon dioxide and methane.
Because of this, radiation from the sun is free to transit the atmosphere, be absorbed by and thus heat the ground. In turn, because the ground is above absolute zero, it re-radiates some energy as infrared and transfers some energy to the atmosphere by conduction, which in turn also emits infrared. Because the atmosphere is partially opaque to infrared, the energy transfer is impeded, and the equilibrium temperature of the ground is something like 20-50K higher than it would have been with a pure nitrogen atmosphere (or vacuum). This is the 'greenhouse effect.'
So, it is incorrect to refer to infrared as 'heat', as is sometimes done. The only special relation between infrared and heat is that room-temperature objects emit in infrared. So-called 'heat lamps' do emit large amounts of infrared, but this is because most everyday objects absorb better (are closer to "black") in that range, and therefore the energy transfer is more efficient. If you wanted to heat a visibly black object, a visible light lamp, or even a laser with a sharp spectrum in the visible range and no infrared at all, would work just as well. I have burned paper with a sufficiently powerful visible-light laser.
Radiation transfer is an extremely interesting problem, and its solution is what put Planck on the road to quantum mechanics in the first place. Go check Wikipedia on Planck's law for more detail than you may care to have.