The Circle of 4ths
The above diagram is referred to as both the Circle of 5ths and Circle of 4ths. This diagram is best thought of as a musical solar system. Each note and position on the circle represents the names of all 12 major keys. The key of C at the top is the only musical key with no sharps or flats (all the white keys on a piano). Moving around the left of the Circle, the keys are laid out 4 notes (a fourth) apart and gain one flat for each key. Conveniently, we can think of the Circle of 4ths like a clock face. This diagram also shows us what the key signature (which specific notes are flat) looks like on a treble clef staff:
Key of C: C, D, E, F, G, A, B, C (zero flats)
Key of F: F, G, A, Bb, C, D, E, F (one flat)
Key of Bb: Bb, C, D, Eb, F, G, A, Bb (two flats)
Key of Eb: Eb, F, G, Ab, Bb, C, D, Eb (three flats)
Key of Ab: Ab, Bb, C, Db, Eb, F, G, Ab (four flats)
Key of Db: Db, Eb, F, Gb, Ab, Bb, C, Db (five flats)
Key of Gb: Gb, Ab, Bb, Cb*, Db, Eb, F, Gb (six flats)
All of these major keys follow the major scale pattern
(W=whole step, or skipping a note- H=half step, directly to the next note)
1 W 2 W 3 H 4 W 5 W 6 W 7 H 1
(Do W Re W Mi H Fa W Sol W La W Ti H Do)
Paraphrased: 2 Wholes and a 1/2, then 3 Wholes and a 1/2)
This pattern makes the major scales more and more complex and full of flats. The formula is nice to know but in reality the scales are memorized from heavy use and application.
*The reason for the crazy looking Cb in the Gb major scale is because of a concept in music theory that states that a scale must be comprised of different note names for each degree (or position in the scale). In Gb, the 4th note (Fa) is Cb, which is the same thing as a plain B, but because there is already an B note in the scale (Bb), there needs to be a 'C' represented (Cb).
Finally, the reason there are technically 13 keys listed is because F#/Gb are equally complex in both sharps and flats (6 sharps and 6 flats each). Because of this, the key is referred to as either sharp or flat (depending on the musician or composer's preference).
Where the Circle of 5ths/4ths is really useful is keeping in mind the common names and existence of all the major keys in music, as well as their complexity. Guitarists and bassists should work down the right side of the circle in Chordal charts. Pianists can work equally down both sides of the circle. Keys that are close together in the Circle are referred to as "closely related" and are often utilized in music that changes key.