To compress a directory, I use:
tar -czvf foo.tar.gz foo
where foo is the name of the directory. (the options used: compress, gzip, verbose, file=foo)
To decompress the file, I use:
tar -xzvf foo.tar.gz
which creates a directory called foo with the files I compressed. (with option: extract)
For more information, see this useful page.