Phonetics refers to the study of all sounds possible within human language that can be a part of a language (burps, coughs, and teeth grinding do not count, since no one uses them in language). A single unit of phonetics is called a phone, indicated by brackets.
In linguistics, there is a sharp distinction between phonetics and phonology. Phonology studies how units of sound fit into a particular language as units that carry meaning. A single unit of phonology is called a phoneme, indicated by slashes.
To illustrate the difference, take a look at the English sound 'p.' There are at least three sounds/phones that we perceive as the sound 'p.' There is the aspirated form, which occurs in 'pot,' the unaspirated form, which occurs in 'spot,' and the unreleased form, which occurs in 'top.'
Since all three of these sounds represent the same phoneme in English, they are called allophones, and as far as understanding is concerned, they are all one in the same in English. In other languages, they could be as distinct as 'p' and 't' is in English.
A language's phonology is constructed by taking all the sounds that occur in the language and deciding which ones are allophones by looking at the sounds in minimal pairs and in similar phonetic situations.
A complete phonology of English would only include /p/ as a voiceless bilabial stop, even though there are more than three p's in English. It also would not include the glottal stop, since although it occurs constantly, we do not recognize it as a sound that carries any meaning.