The generic answer for "how to determine" is to read the manual page for
tar by issuing the command
man tar on your system. (The linked page is a manual page for
tar, but by issuing the command on your system you'll ensure you have the manual page for the version you are currently using.)
From the manual page you'll see that the
z option causes the file(s) to be filtered through
gzip, which by convention have the extension
.tgz, while the
j option causes the file to be filtered through bzip2.
Versions of GNU
tar since 1.15 (2004-12-21) autodetect common compression methods, so neither the
j nor the
z will be necessary on linux distributions of the last decade or so.
tar xf ... will untar a file whether it is an uncompressed archive, a
gzip-compressed archive, a
bzip2-compressed archive, or several other formats. Other unix or unix-like systems (or linux distributions which don't use GNU tools ?) may not have this shortcut available.
As to the secondary question, the
t option request only listing the files in the archive, while the
x option actually extracts the files.