Here I will only consider spacecraft (small bodies) orbiting planets (large bodies). Orbiting bodies rotate around their centre of mass, which in the case of similar sized bodies would have them rotating around a point in space midway between them. There are few cases of this in our solar-system. Pluto and Charon is one, and the only large one. If you want to investigate such things, then you should look here.

A spacecraft in orbit around a planet describes an ellipse with the planet at one focus. Such an ellipse has two ends, one at the closest approach to the planet called periapsis^{1}, and one at the further distance from the planet called apoapsis. The spacecraft will be travelling fastest at periapsis and slowest at apoapsis.

A spacecraft in orbit around a planet is not in zero gravity. In fact, for low orbits, the gravity is still quite close to that on the planet's surface.^{2} Astronauts float around because they are in free-fall; they are feely falling toward the planet. You can think of it like this: the spacecraft is falling toward the planet, but it is also moving fast, so that by the time it would have hit the planet it actually misses it. See the picture to the right.The spacecraft starts at point A with a certain velocity. Gravity pulls it toward the planet, but it actually falls to point B. When the spacecraft is at point B its velocity will be downwards and the planet will be pulling to the right, which is the same situation as at A, just turned ninety degrees.Of course it is more complex than this, because the direction the planet is pulling changes all the time, but this is the basic mechanism.

In order to understand any more details, we have to understand escape velocity. This is the speed that the spacecraft has to be going to escape from the planet altogether. If the spacecraft is going slower than this it will be in orbit, but if it is going too slowly then that orbit will intersect the surface of the planet. If the velocity is exactly right, then the spacecraft will be in a circular orbit — it will always be the same altitude above the planet. It so happens that the relationship between the escape velocity and the circular orbit velocity is very simple. It is just a factor of $\sqrt 2$. See the right side-bar if you must know the details. Since Newtons laws are symmetrical, if a body drops from infinity, it will be going at the escape velocity when it hits the planet. The escape velocity depends on your altitude; higher up there's less gravity, so escape velocity is lower.

So far as the maths is concerned, a planet's mass is concentrated in an infinitely small point at it's centre. You only need to consider the size of the planet if you are worried that you might hit it.^{3} That means that if you are calculating orbits, you have to remember that (for the maths) an orbit's radius is measured from the centre of the planet but (describing it) it's altitude is measured from the surface.

In order to get from one orbit to another we have to burn fuel. If we accelerate our spacecraft from a circular orbit it will go into an elliptical orbit with the periapsis at the point at which we did our burn. At some later point we can burn fuel again to put the spacecraft in a circular orbit wider than the original one. If we wait until apoapsis to do that, then we use the minimum amount of fuel, but we have to wait for half the orbital period. When we are talking about interplanetary travel that can be months. If instead of accelerating the spacecraft we decelerate it, then we go into a smaller elliptical orbit with the burn point as the apoapsis.

To launch a spacecraft from the planet, we just accelerate it so that it reaches orbital velocity at the same time as it reaches a position on that orbit. Rockets appear to go straight up, but they curve over and most of their acceleration is horizontal. To land a spacecraft you just decelerate it so that its orbit falls within the atmosphere. On an airless world you have to kill all the orbital velocity so you are falling directly toward the planet, and then use your rockets vertically, directly against gravity.

As we accelerate the spacecraft more, the apoapsis of the orbit gets higher. Eventually it reaches infinity. The ellipse will have the same basic shape, but it's ends are open — it is a parabola. This is when the speed is the escape velocity. As the speed keeps increasing the ends open out more — a hyperbola. A hyperbolic flight is one past a planet, where the velocity is above the escape velocity. The spacecraft curves around the planet in a wide arc, but doesn't go into orbit around it.