Welcome to LQ!!
First--if it all possible, always use the package manager to install SW. You will find this in your menus----Look for Synaptic or Adept---or maybe something that just says "install programs" or "install software".
If you have to install something that you downloaded, then it depends very much on exactly what it is. Most downloaded SW will come with instructions--often in a "README" file included in the package.
Whenever you see "tar.gz", tar.bz2", etc. you first have to extract from the archive---eg:
for tar.gz: tar -xzvf filename
for tar.bz2: tar -xjvf filename
These commands are normally issued as the root user. In Ubuntu, unless you have enabled the root account, just add "sudo" in front of any command that needs admin (root) privileges.