So a dipole moment basically expresses the magnitude of a molecules polarity, and a polar molecule will have a separation of charge...partial positive/partial negative.
The simplest example is water, the two H--O bonds have a partial negative charge on the oxygen, and a partial positive charge on the hydrogen. Oxygen is significantly more electronegative than the hydrogens, which have an electronegativity of about 2.1, and oxygen has one of about 3.5 (it is useful to know that across the periodic table from C to F, the electronegativities are 2.5 to 4.0, increasing by about 0.5, only for that particular row and set of 4 elements)
Thus, oxygen being more electronegative, strongly draws the electrons from the hydrogens, and because it has a bent structure (unlike CO2 which is linear), the two bonds do not "cancel out", and have a net dipole towards the oxygen atom. That being said, the dipole moment being charge x distance, water has one. As the distance between the partial positive and partial negative atoms increases, the dipole moment will increase because the relationship is a direct one (on opposite sides of the equal sign in the equation, if that helps)...
So take for example an amino such as glycine, which at neutral pH is a zwitterion and has both a positive and negative end, and because oxygen is more electronegative than nitrogen, the electrons will be drawn towards the carboxylate group, and because the electrons charges are separated by the length of the molecule, that accounts for the large dipole of glycine. If you take into account a larger distance, the dipole will be larger.
Electrostatic forces have to do with the charges on a molecule, if the charges are alike, the force would be repulsive, different charges would be attractive. However this is a force, and the dipole moment is the magnitude of the distribution of charge across the molecule, and not the interaction of the charges.