What OS do you use?
On Windows you should install cygwin (google it) and then, gcc will be there already. And on Windows you do not want to mess with tar.gz files. Just use gcc available in cygwin. And better do not use Windows at all.
On MacOS you have tar and gzip. See the note for Linux and use terminal. Usually, however, you do not want to mess with tar.gz files. Istead, there is a way to install gcc from img file like other Mac applications. Well, there are many other ways.
On Linux, gcc must be already installed. If you need newer package, use your package system. If you need exactly that tarball, then try to
tar zxvf filename.tar.gz
./configure
make
sudo make install