Most light sources used for photography emit the so-called "white" light, containing a mixture of all colours. Such light is said to have a continuous spectrum, although its precise colour mixture can vary considerably from one light source to another.
These light sources can be given a "colour temperature" which describes their colour value and is measured in units called kelvin (K). This temperature scale measures the relative intensity of red to blue light.
Warmer light tends to cast orangish-red tint across the image and has a lower temperature. Neutral or balanced light which is in the middle ranges has little impact on the image's colour values because of its white qualities. Cooler light such as outdoor daylight is a lot bluer in appearance and has a high temperature.
White objects in these different lighting conditions objectively look more blue (in daylight), more red (in incandescent lighting), or more green (in fluorescent lighting).
Our brain is equipped to adjust for different colour temperatures so that white almost always looks white, no matter what colour light we are seeing it in. For example, a white car during a sunset objectively looks quite orange, but if someone asks you what colour the car is, you would reply with certainty that the car is white.
Digital image sensors, on the other hand, record only what they objectively receive. In order to take into account the various colour tints different light sources cast over an image, cameras are equipped with a white balance setting which allows you to specify exactly what the colour temperature of the scene is.
In most cases, your camera can automatically adjust to conditions by sampling the colour content of the surrounding light where the brightest value is assumed to be white and adjusting all other colours accordingly. If the brightest value is indeed white, the colours in the image are rendered correctly. If the brightest colour is yellow, however the camera still assumes that the value is white, and shifts all the colours out of balance. This is important to know when switching between different lighting scenarios.
You may find that you get better images when you manually adjust the white balance setting of your camera to match the light source in the scene you are shooting. This is especially true if you shoot in a room with fluorescent or tungsten light.
It is also good to remember that within limits you can make further colour temperature corrections later with the use of digital manipulation software. The reason for this is that the colour temperature data is stored as metadata in the image while the digital data that makes up the original RAW file is unchanged. This allows for the colour temperature of the image to be corrected, no matter what settings were applied at the time of taking the photograph.
If you get in the habit of manually adjusting the white balance, remember to reset the white balance to auto when you are done with each shoot. Otherwise, you might forget that your camera is balanced for fluorescent light when you shoot outdoors, and you will get very funky results.
Don't think that white balance can only be used to get the correct colour of an image. You can play with the white balance settings and use them to get some creative results. As a photographer your job is to capture the colours you see as intentionally as possible. You can, for example, misadjust the w. balance to get warmer colours when shooting portraits.
Do not forget that photography is all about trying new things and having fun !