Simply put, rockets overcome the pull of gravity by moving very fast relative to the Earth. Although it is not strictly possible to entirely escape the gravitational pull of the Earth, as gravity propagates outward at the speed of light, it is possible to achieve escape velocity by assembling a huge supply of volatile rocket fuel and launching a payload at approximately 11 kilometers per second, according to NASA.
Getting into space takes relatively little energy. Simply rising above the bulk of the Earth's atmosphere to the boundary of space requires just enough fuel to ascend about 100 kilometers. Flying higher than the Karman line, however, requires a craft to accelerate to orbital velocity, at which point it will remain at altitude until its orbit decays. The exact value of orbital velocity varies depending on altitude with higher velocities needed to achieve higher orbits.
Rising to higher altitudes beyond the boundary of space is simply a matter of going ever faster. According to NASA, to place a spacecraft into an orbit 100 miles high, for example, requires a sustained orbital velocity of exactly 17,478 mph. Achieving a trajectory that escapes the pull of the Earth entirely calls for still more speed; when the craft has accelerated beyond 7 miles per second, it will leave the Earth behind.