Twelve keys
A, A♯, B, C, C♯, D, D♯, E, F, F♯, G and G♯, then A again.
One octave, from A to A. The number on each key tells you how many frets up the string that note is. There are seven white keys and five black, and then the pattern starts again.
Twelve frets
One string tuned to A, frets 0 to 12.
The A string from open to fret 12 holds the same twelve notes in the same order, as twelve identical frets. Nothing about a fret tells you which note it plays.
A guitar string is a piano laid flat. Each fret is one key. When you press the next fret up, the pitch rises by a semitone, which is the smallest step in Western music. After twelve of those steps you arrive back at the note you started on, one octave higher.
A keyboard makes this pattern easy to see. It has twelve keys to the octave, seven white and five black, and then the pattern repeats. The neck holds the same twelve notes as twelve identical frets, so nothing about their shape tells you which note is which. That is the main difference between the two instruments, and the rest of this course builds on it.