In the field of phonetics a phoneme is the smallest unit sound that gives a difference in meaning. The sounds /p/ and /b/ are nearly the same (/b/ is voiced and /p/ is unvoiced), but this comparatively small difference in sound is very important in English. The words 'push' and 'bush' have different meanings, and would rarely be mistaken for each other.
Allophones, on the other hand, are sounds that are technically different, but not different enough to change the meaning of a word. The /p/ sound in the words 'pea' and 'poor' is slightly different, but this small change does not make any difference to the meaning of any English word. (Moreover, you might find it very difficult to use the 'pea' 'p' when saying 'poor'; the shape of the lips is directed by the following vowel sound, and these allophones are hard to interchange). In phonological terms, there is no 'minimal pair', no set of two words with different meanings that are them same except that one has one 'p' sound and the other has the other 'p' sound. The 'push' and 'bush' example given above is a case of a minimal pair for voiced and unvoiced bilabial fricatives (/b/ and /p/).
In phonological transcription, phonemes are distinguished by placing a letter between slashes (/s/), while allophones are distinguished by placing it between square brackets ([s]). There is an exception to this rule with stressed and unstressed vowels. For example, the vowel sound 'ay' is transcribed differently depending on stress. It becomes the diphthong /eI/ in stressed syllables ('humane' becomes /hjumeIn/), while in unstressed syllables it is left as simply /e/ ('ingrate' is transcribed as /ingret/).
Often the characteristics of an allophone within a language are determined by where in a word it appears. In English the phoneme /t/ is usually aspirated when appearing at the beginning of words ([th] in 'tap'), but not aspirated at the end of words ([t] in 'pat').
Sounds considered allophones in English may be heard as different phonemes in other languages. In Chinese /p/ is considered a different phoneme than the aspirated /ph/. Another example is the [td] sound that appears in the middle of 'butter'. In English this is an allophone of /t/, but in Thai it's a separate phoneme.