Except for noble gases, atoms of most of the elements are found in the combined form with themself or atoms of other elements. It is called a molecule.
A molecule is made up of two or more atoms bonded together by chemical bonds (strong chemical forces of attraction).
All compounds are molecules, but all molecules are not compounds. Why?
molecule can be made up of two atoms of the same kind, whereas a compound must contain at least two different elements.
Different types of chemical components.
Examples of atoms: \(C\), \(Na\), \(Ne\), etc.
Examples of molecules: \(H_2\), \(O_2\), \(N_2\), etc. 
Examples of compounds: \(H_2O\), \(HCl\), \(CO_2\), etc.
Classification of molecules
According to the law of definite proportions, a molecule may contain atoms of the same element or atoms of two or more elements joined in a fixed ratio. Thus, a molecule may be an element or a compound.
If the molecule is made of a similar kind of atoms, it is called a homoatomic molecule. The molecule that consists of atoms of different elements is called a heteroatomic molecule. A heteroatomic molecule is known as a compound.
The number of atoms present in the molecule is called its ‘atomicity’.
Number of atoms present
Let us consider oxygen. Oxygen (\(O_2\)) and ozone (\(O_3\)) are two allotropic forms of oxygen gas. There are two oxygen atoms in an oxygen molecule; hence, its atomicity is two. Similarly, there are three oxygen atoms in the ozone (\(O_3\)), hence, its atomicity is three.
Monoatomic gases:
Monoatomic means it contains only one atom.
Example: Noble gases, (\(He\), \(Ne\), \(Ar\), \(Kr\), \(Xe\), \(Rn\))
Diatomic molecule:
Diatomic molecules are made up of two atoms that are chemically bonded.
The diatomic molecules containing two identical atoms are called homonuclear diatomic molecules, whereas the diatomic molecule containing two non-identical atoms are called heteronuclear diatomic molecules.
Example for homonuclear diatomic molecule: \(H_2\), \(O_2\), \(N_2\), \(F_2\), \(Cl\), \(Br_2\), \(I_2\).

Example for heteronuclear diatomic molecule: \(CO\), \(HCl\), \(HBr\), etc.
Homo and heteronuclear diatomic molecules
Triatomic molecule:
Triatomic molecules are made up of three atoms that are chemically bonded.
The triatomic molecules containing three identical atoms are called homonuclear triatomic molecules, whereas the triatomic molecules containing at least one non-identical atom among the three atoms are called heteronuclear triatomic molecules.
Example for homonuclear triatomic molecule: \(O_3\)
Example for heteronuclear triatomic molecule: \(CaCl_2\), \(H_2O\)
Homo and heteronuclear triatomic molecules
Polyatomic molecule:
A molecule that contains more than three atoms is called a polyatomic molecule.
Example: \(CH_4\)