A molecule is said to be polar if it has a net dipole moment, i.e. if the bond dipole moments do not cancel each other. Think vector addition.
The bond dipoles that arise from the uneven distribution of charge between two atoms that share electrons have a magnitude and a direction.
When a separation of charge like the one shown above exists, a molecule is polar. But if two bond dipole moments cancel each other out, the molecule will be non-polar.
The difference between carbon dioxide and water, two molecules that have a plance of symmetry, lies in the orientation of the bond dipoles.
Water's bond dipoles have two components, one on the x-direction and one on the y-direction. The ones on the x-direction point towards each other, so they cancel each other out.
But the ones on the y-direction point upwards (in the same direction) so they don't cancel each other out
That is why the molecular geometry of a molecule plays such an important role in determining its polarity.