From TalkBass Wiki
Intonation refers to the correctness of pitch over the length of the neck. The laws of physics tell us that, all other things being equal, halving the length of a string will double it's frequency; thus, fretting a note at the twelfth fret (which halves the string) should produce a note exactly one octave above the open string.
In a perfect world, this would be true, and the twelfth fret could be permanently placed exactly at the halfway node of the string, where it produces the octave harmonic. Because of many factors, including the thickness and stiffness of the string (which is not a physically ideal, one dimensional entity) and especially the fact that fretting a note slightly raises the string tension, we must adjust the length of the string, and thus, the positions of the frets, to compensate.
[edit] Procedure
Adjusting intonation requires a trained ear, or a tuner, and should be done with the instrument in tune, and setup. For each string, compare the fretted note at the twelfth fret, with the first harmonic (at the twelfth fret), or a tuner. If the fretted note is sharp, the bridge must be adjusted by moving the saddle for that string away from the neck, making the string longer. If the note is flat, the opposite holds true, and the string must be shortened by moving the saddle towards the neck.