Radiation spans a huge range of wavelengths, and thus photons can have a correspondingly large range of energies. From short wavelengths to long (and thus high to low frequencies), these ranges are gamma ray, X-ray, ultraviolet, visible, infrared, microwave, and radio. Astrophysical objects emit some wavelengths more than others, depending on what they are. Low-mass stars radiate in infrared and visible, whereas supernova remnants emit X-rays and visible.
The cosmic background radiation currently emits mainly at microwave wavelengths; its radiation intensity peaks at a wavelength of approximately 2 millimeters (about 0.1 inch). However, photons stretch as the universe expands, and their wavelengths get longer (energy decreases) as the expanding universe gets older. Therefore, the cosmic background radiation used to have a shorter wavelength (higher energy) when the universe was younger and smaller. When the universe was 1 million years old, the cosmic background was mostly infrared radiation.
In addition to the cosmic microwave background radiation left over from the early universe, today we observe photons emitted from stars and galaxies in the cosmos at all frequencies, including gamma ray, visible, infrared, and radio. This emission from stars and galaxies is typically brighter, and thus more easily observed, than that from the background radiation. — Dragan Huterer, University of Michigan, Ann Arbor