In the case of atoms there are two forces to consider (gravity and the weak nuclear force are negligible in magnitude) - The Strong Nuclear force and the Electrostatic force. It is the Strong Nuclear force that keeps the various protons together and as a result we have the atom and the same is responsible for the holding together more than one atom.
The forces that are holding two atoms together are the strong force, weak force, and gravity.