Such a group of atoms is called a molecule. Obviously, there must be some force that holds these constituent atoms together in the molecules. The attractive force which holds various constituents (atoms, ions, etc.) together in different chemical species is called a chemical bond.
There are 4 types of chemical bonds which are formed by atoms or molecules to yield compounds.