Light is one small portion of the electromagnetic spectrum.
As seen above, light at one end of the visible spectrum has shorter wavelengths near the 400nm range of the spectrum producing a "blue" visual sensation.
Medium wavelengths in the 500-600nm range produce a "yellow to green" sensation. Longer wavelengths produce a "reddish" sensation.
The color temperature of a light source is a numerical measurement of its color appearance. It is based on the principle that any object will emit light if it is heated to a high enough temperature and that, as the temperature increases, the color of that light will change along with the temperature.
If you have ever seen a blacksmith at work heating a horseshoe (or maybe in an old Western), you would see that the horseshoe glows "red hot." It was heated enough so that it gave off light, red light in this case. Keep heating it and it would go from red to orange to yellow to white and, finally, to blue white.
A light source's color temperature, then, is the temperature at which the color of the horseshoe would match the color of the light source. We express this temperature in degrees, but not Fahrenheit degrees like we are used to, but in Kelvin.
This scale was named after Lord Kelvin, a British inventor. The correct unit is "kelvin" (lower case), not "degrees Kelvin."
So, for example, a light source may be specified as having a color temperature of 4100 kelvin or 4100K. This means that this particular light source would have a slightly bluish, somewhat cool color appearance, the same as if our horseshoe were heated to 4100 degrees on the Kelvin scale.
The object used for correlating the color temperature (CCT) is a theoretical object called a "blackbody radiator." Keep in mind, however, that the light source really isn't the same thermal temperature as the theoretically heated object. Color temperature is just a way of correlating the source's appearance to that of a heated object.
Warm vs. Cool - the Psychology of Light
Some people find it confusing that low color temperature light sources are called "warm" while those with higher color temperatures are called "cool." In fact, these descriptions have nothing to do with the temperature of the horseshoe (blackbody radiator). They refer to the way color groups are perceived - the psychological impact of lighting. Colors and light sources from the violet/blue end of the spectrum are referred to as "cool," and those toward the red/orange/yellow side are "warm"
How Light Affects the Colors of Objects
Have you ever noticed that the rug you bought in the store wasn't the same color when you brought it home? Well, the reason is the light sources were different. Here is a way to assess how light sources make objects appear. It's called Color Rendering Index (CRI) - a system derived from visual experiments. If you had a light source you wanted to assess, here is what you'd do. First, get out your set of eight standard color samples as seen here:
Illuminate them with your light source, then with a "standard" source, and compare the way they look. If none of the samples appear to be a different color, then your light source is given a rating of 100 CRI. Any change in color of the samples would evoke a lower rating. The CRI decreases as the average change in color appearance of the eight samples increases (in the real world, we use some calculations to determine the rating.)
With knowledge of both CCT and CRI, a general impression can be given of how objects or a space will appear. Selection of a light source for a particular application however, must take into account many other factors, such as the interior design, the "mood" one wishes to convey, and even the economics.