It should be noted that rshaw's example extract command will only leave you with a filename.tar file, not the contents of the tar. If you just have a .tar file then use
tar xvf filename.tar
to extract the contents. Peronally I like to see what it's extracting hence the 'v' in the above (verbose) if you don't want the lisings remove the v.
You can also do it all in one go if you have the GNU version of tar (99% likely) by doing a
tar xvfz filename.tar.gz
which will first run the file through gzip for you (BTW gunzip is really 'gzip -d'). If you're using a bzip2 file there is a command to tell tar to first filter it through a program (in this case bzip2) but I can never remember it so I use
bzip2 -dc filename.tar.bz2 | tar xvf -
The way you think of it is that tar joins lots of files together, and gzip/bzip2 compresses them to make them smaller. Unlike the .zip format that you have no doubt used in the past .gz files can contain only a single file, hence the use of tar first.