Let's start at the beginning.
A note is a name for a given frequency. The most well-known note is "middle C" (or C4) , followed by "A440", which is the frequency 440 Hz assigned to the A above middle C, A4.
The human auditory system regards two notes whose frequencies are in the ratio 2:1 as very harmonious. This is because musical instruments do not produce pure sine wave tones, but a sound that is a mixture of the fundamental frequency and many others, called “overtones”. Playing A440 will usually also generate an "overtone" of A880, and so it sounds pleasantly matching when played against A880 as a note. This is so much so that two notes related by double frequency are regarded as "the same but higher".
This splits the range of audible frequencies into ranges called octaves. Pick a starting position, say A4 = 440, and we have octaves as follows:
A7 = 3620 (almost the highest note on the piano)
A6 = 1760
A5 = 880
A4 = 440 (“tuning A”)
A3 = 220
A2 = 110
A1 = 55
A0 = 27.5 (lowest note on the piano)
(Why is it the lowest? There are pianos which go even lower, but below about 25Hz, the human ear stops hearing a continuous sound and starts to hear the individual beats. The highest note on the piano is 4120Hz and it's very difficult to produce an acoustic instrument that can produce that with significant volume.
The octaves are not the same size in terms of the range of frequencies, but the ratios of the frequencies are all the same. Each octave is double the previous one.
Each musical culture picks a different number of different frequencies within an octave to be its "notes". European music eventually settled on a series of frequencies, each one related to the previous one by the same ratio, the 12-th root of 2 (roughly 1.05946). This is called Equal Temperament, and it makes manufacturing and learning to play musical instruments way easier than the other European system did.
The "distance" between two notes is not measured in hertz (the ear doesn't work like that), but in powers of the 12-th root of 2 (roughly 1.05946). A power of the 12-th root of 2 is called a semitone. (Mathematicians can prove this is indeed a distance function as an exercise.)
Given a note X, the note one semitone up is X♯ and the note one semitone below is X♭. Replacing a note by the flat or the sharp is called flattening or sharpening the note. Under Equal Temperament, (X-1)♯ is the same note as X♭ - these are called enharmonic equivalents.
For more details, see the excellent and best-selling Your Brain on Music.
For more details, see the excellent and best-selling Your Brain on Music.