Newton's law of Universal Gravitation tells that Force between two objects is directly proportional to the product of their masses and inversely proportional to the square of the distance between them.
As there is mass for every object, and they are separated by certain distance (from 1 cm to more than hundreds of light years), they exerts Gravitational force on each other
Hope this helps!