Hello and welcome to LinuxQuestions,
Check out the man pages for tar
They will tell you a lot. First of all the tar.gz and tar.bz files are archive files that where archived using the tar program. So you'll need the same program to extract them. Kind of like zip in Windoze environment. the extension gz and bz means that they were compressed using the gzip or bzip program.
To unpack the file just type in at the console:
tar xzvf packagename.tar.gz
After that you'll have a directory created in the one where you unpacked the package. CD into that directory and look for INSTALL or README or similar files. If its the source of a program the you downloaded (tarball) then you'd have to execute
to install the program. But always first look at the readme files.