A phoneme is a 'base' sound (or phone) in a language that is recognized as distinct or unique; an important sound in the language. For instance, in English, /t/ is a phoneme, but it can be pronounced a number of different ways; in "star" it is a [t], but in "kitten" it represents a glottal stop (for many speakers), whereas in North America in the word "latter" it represents a flap (closer to a [d]!).
One way to understand a phoneme is that a good sound-based writing system would have precisely one symbol per phoneme. English does not have a very good phonemic system (consider that the word "through" has seven letters but only three phonemes: th, r, oo). Digraphs such as "th" and "sh" indicate phonemes that do not have their own letter, while sometimes two letters (e.g. "j" and sometimes "g") may also cover one phoneme ([dž] (bridge)), or one letter (e.g. "a") may represent many phonemes (ate, at, are, swat). Spanish, Arabic and Korean are all good examples of phonemic writing systems.
The separate sounds that one phoneme may be realized as are called allophones. Sometimes it is not clear which form is actually the "main" or underlying form. Again, English /t/ is a good example; it is almost never realized as [t], especially in North American dialects, where it can pick out a flap (butter), a glottal stop (kitten), an aspirated [t] (attack), silence (but), or "sh" (action), and only makes the actual sound [t] when it comes after [s].