Since an oxygen atom has 6 electrons in its outermost shell so, it needs 2 more electrons to achieve the stable 8-electron inert gas configuration. Hence, it combines with another oxygen atom and forms a molecule of oxygen.

This type of bonding is called a double covalent bond.