You may have seen sharps and flats in music: a sharp looks like a hashtag (♯) and a flat looks like a lowercase B (♭). They are placed to the left of a note head and indicate that the note to follow is played a half-step higher (for a sharp), or a half-step lower (for a flat). The C scale, comprises the white keys on the piano: eight notes, all the white keys, starting on C. The sharps and flats are the black keys.
The starting note of the scale, or tonic, is also the name of the key. You may have heard somebody say "It's in the key of C" or something similar. This example means that the basic scale starts on C, and includes the notes C D E F G A B C. The notes in a major scale have a very specific relationship to each other as semitones or whole tones.
Note that between most notes, there is a whole step. But there is only a half-step (semitone) between E and F, and between B and C. Every major scale has this same relationship: whole-whole-half-whole-whole-whole-half.
In order to cut down the confusion and make music easier to read, key signatures were created. Each major scale has a particular set of sharps or flats, and those are shown at the very beginning of the music. Looking again at the key of G, we notice that has one sharp—F#. Instead of putting that sharp next to the F on the staff, we move it all the way to the left, and it is just assumed from that point on that every F you see is played as an F#.