Reading the numbers
Each digit is the sum of read (4), write (2) and execute (1) for one class of user: owner, group, others. So 7 = rwx, 5 = r-x, 4 = r--. A fourth leading digit sets the special bits: setuid (4), setgid (2) and sticky (1).
Common modes
644: normal files; owner can edit, everyone can read.755: directories and scripts.600: private keys and secrets, such as~/.ssh/id_ed25519.1777: shared temp directories like/tmp; the sticky bit stops users deleting each other's files.
FAQ
What does a capital S or T mean?
In ls output, s/t means the special bit is set and execute is also set; S/T means the special bit is set without execute, which is usually a mistake.
Is 777 ever a good idea?
Rarely. It lets every user on the machine change the file. Prefer 755 or 775 with the right group.