The letters over each bar relate to the chord that will fit with those notes. The bar saying C will work because a C major chord is made up from the 3 notes C, E and G. It may have more than one of each when played on a guitar, for instance, but will have those 3 notes, sometimes at different octaves.
The notes played in that first bar are E,E,F,G so the majority of them fit the chord of Cmaj. Bar 2, with G,F,E,D will fit over G, or better still, G7,which contains G,B,D,F.. Again, most notes from the chord. Interesting, bar 12 usually has a D or D7 for the first part. It works as D7 is D,F#,A,C. Your next question may be so why is bar 6, with the same notes as bar 2, showing an F, not a G?