All the mentioned force follows inverse square law, i.e. the
strenth of all these force is inversely proportional to the square
of the separation distance between the object's centers
All these force are central forces i.e. angular momentum
conservation occurs
All the three forces are conservative forces
Differences
Gravitational force is always attractive however electrostatic
and electromagnetic forces can be attractive as well as
repulsive.
Gravitational force does not depend on the medium, whereass
electrostatic and electromagnetic force does depend on the
medium
Electrostatic force is the force between static (not moving
relative to each other) electric charges. Electromagnetic forces
are any interactions due to photon exchange and incudes
electrostatic forces.
Gravitational force are generated from mass however other two
forces are generated from charges.