If an object is projected fast enough from the surface of a heavenly body it will break free of its gravitational field.

The formula for the escape velocity $v_e$ of a body of mass M and radius r is:

$V_e=\sqrt{\frac{2GM}{r}}$

where G is the Universal Gravitational Constant: $G=6.674\times10^{-11}$

The escape velocity from the surface of the Earth is 11.2 km/sec (7.0 miles/sec), not to be confused with orbital velocity at grazing altitude, which is smaller by a factor of $\sqrt{2}$