The key signature will give you information about the tonal area of a piece. The key of your instrument is relevant to reading a piece of music. If you play a Bb or Eb instrument, for instance, you will need to determine the "concert" pitch or what it would be played in on a C instrument such as flute or piano.
With modern or improvised music you may have key changes within the piece and so the best way to determine key is to find where the piece comes to rest. Look at the last bar of the music. What is the last note or chord? Almost invariably it will be the tonic or first note of your key.
Also because major and minor keys have the same key signatures it is useful to know about relative keys. The key signature for C major, for instance, will be the same for A minor, except if you look at the melody or chords they will have a different seventh degree.
C major scale: cdefgabc ; b is the 7th
A harmonic minor scale: abcdefg#a ; g# is the 7th
A complete knowledge of scales, major and minor, will help you enormously.
If you are playing pop or folk music with a few repeated chords look at or listen for the I and V such as G (I) to D (V) [I = tonic, V = dominant]. This will stick out if you listen to the tune and will tell you that the key is G.
For further understanding, look up the words cadence, dominant chord, tonic.