In the G major scale all F notes are sharpened. Rather than add a sharp to every note, however, an easier method is used whereby a sharp sign is placed on the F line (the top one) of the staff at the beginning of each line. This is referred to as the key signature: thus the key signature of G major is F sharp.
You will notice that the F# is necessary in order to maintain the correct interval sequence of the major scale. Tone-Tone-Semitone-Tone-Tone-Tone-Semitone (which, in turn gives rise to the familiar sound of DO RA ME FA SO LA TE DO).
The key signature of G has one sharp (F#)