|Two-dimensional analogy of spacetime distortion generated by the mass of an object. Matter changes the geometry of spacetime, this (curved) geometry being interpreted as gravity. White lines do not represent the curvature of space but instead represent the coordinate system imposed on the curved spacetime, which would berectilinear in a flat spacetime. Credit: Wikipedia|
Newton's law for gravitational force is described by: F = G MA MB / r2
Where G is the gravitational constant, M is the mass of the body, and r is the vector position between the object with mass A and the other object with mass B. This force is a vector that increase with the mass of each object and decrease with the square of the distance between them.
Now you can see a great experiment about it.
I recommend the reading of this article: Why does gravity get weaker with distance?