In the simplest case of a constant force F over time, and a constant mass M over time, Newton's Law states F = Ma, where a is the acceleration, which is now also constant with time.
And we also know the distance traveled formula, x = vt. The derivative of x with respect to time is dx/dt = v or velocity. Furthermore, the second derivative of x then equals the first derivative of v which is just acceleration a.
So d2x/dt2 = dv/dt = a.
Putting all this together: a= F/M = d2x/dt2
Or solving it for x, x= (F/2M)t2 assuming velocity and distance were zero at time zero.
This shows how the mass M affects distance x.