As we know, a set of 12 keys (7W + 5B) repeats on an instrument.

Considering a standard 5-octave keyboard,
every note appears 5 times on the keyboard.
To uniquely identify and write each note, let us first give unique names to the octaves as seen from the below diagram.
A standard 5-octave keyboard

So from the above diagram, we see that the different octaves are represented with the help of dots above or below the reference note.
Note that many instruments having different number of octaves. Few Examples:
- Harmonium – 3.5 octaves
- Guitar – 4 octaves
- Standard Keyboard – 5 octaves
- Piano – 7.5 octaves (highest among all) !!!
Hence, considering piano as the reference, the notes are numbered according to the octaves.