chmod 640 (rw-r-----) explained

The owner can read and write; the group can read; others have no access.

Octal
640
Symbolic
rw-r-----
ls -l shows
-rw-r-----

Who can do what

Class Read (4) Write (2) Execute (1) On a directory
Owner (u)YesYesNoList the file names, but not open them.
Group (g)YesNoNoList the file names, but not open them.
Others (o)NoNoNoNo access.

When to use chmod 640

Lets the owner read and write, the group read, and gives nothing to others.

A good mode for configuration files that contain passwords and are read by a service running under a shared group, for example a web server reading an app's config.

Commands

Set the mode with octal digits, or with the equivalent symbolic form:

chmod 640 path/to/file
chmod u=rw,g=r,o= path/to/file

To apply it to every directory below a folder (and not to the files), combine it with find:

find path/to/folder -type d -exec chmod 640 {} +

chmod -R 640 changes files and directories alike, which is rarely what you want: directories usually need execute, regular files usually should not have it.

Work out any mode in the Chmod Calculator