What if we wanted to find the speed needed to leave orbit entirely? This is what NASA did during our trips to the moon, and what NASA will do for our upcoming trips to Mars. The calculation is more complicated than getting to orbit, but we can find the speed needed by using a a familiar example of dropping a ball on the ground.
First, let's talk about energy. Total energy is expressed in two forms: kinetic energy (energy proportional to the speed of the ball) and potential energy (energy proportional to the distance above the surface). Before you drop a ball, it is motionless, so its kinetic energy is zero. Right before the ball impacts the ground, it is right next to the surface, so its potential energy is zero.
The total energy throughout this entire trip must remain the same, so we can set the the potential energy before dropping the ball equal to the kinetic energy right before it hits the ground. Solving this equation gives us a final velocity equal to the square root of 2 * times the acceleration due to gravity * the original height the ball was dropped from. Note that just like with getting to orbit, the speed does not depend on the mass of the ball.