How does gravity affect distance?

Gravity does not affect distance, gravity has nothing to do with distance. However, the effect of gravity decreases with increase in separation.