What has been said is true as far as it goes, but there is some theory underneath that is very important. There is a potential called surface energy in the junction of a semiconductor device. This is the energy required to free an electron or charge carrier. Depending upon the choice of dopants (the deliberately introduced impurities, which is why LED's have such exotic chemical names associated with them), that energy ranges from about .4 volts for hot carrier devices, and can be massaged up to about .9 volts with a lot of effort and exotic compounds. So when electrons or charge carrier cross the junction and recombine, the energy that was expended to free the electron or charge carrier has to go somewhere. Mostly it is heat, but If you design it correctly, you can get some of that energy to appear as photons,
and it just so happens that a .4 electron volt has a wavelength that corresponds to Infra-red, and a .9v electron volt photon corresponds to Ultra violent. By picking the right dopant to create the desired band gap, you can produce differing LED colors. This difference also explains why higher voltages are needed produce light output from Blue LED's then from Infra-red. The extra voltage has to come frome somewhere. You probably cannot produce band gaps much higher than about 1 electron volt, since that is roughly bond energy for most semiconductor, ergo they are likely to become unstable if you could find a way to get the band gap up to the bond energy.