A water molecule consists of two atoms of hydrogen covalently bonded to one atom of oxygen. The oxygen atom is more electronegative than the hydrogen atom and thus the electrons are not equally shared in the bonds. The electrons in the bonds within the water molecule spend slightly more time around the oxygen atom and less time around the hydrogen atom. This creates a partial negative charge around the oxygen atom and a partial positive charge around the hydrogen atom. This is called a bond dipole.
Oxygen has 6 valence electrons that are shared with two hydrogen atoms. The two lone electron pairs that are not bonded to any other atoms, exert a repulsion on the two bonds with hydrogen atoms and this creates a slight compression angle of 104 degrees.
Due to the lone pair of electrons, the water molecule is a bent shape. And due to the bent shape of the molecule, water is a polar molecule.
In a linear shape molecule, equal and opposite bond dipoles cancel each other out and the result is a non-polar molecule even though the bonds are polar. In a bent shape molecule, the dipole forces in the bonds do not cancel out and this results in a molecule that is polar.