Orbital speed

In gravitationally bound systems, the orbital speed of an astronomical body or object (e.g. planet, moon, artificial satellite, spacecraft, or star) is the speed at which it orbits around either the barycenter or, if one body is much more massive than the other bodies of the system combined, its speed relative to the center of mass of the most massive body.
The term can be used to refer to either the mean orbital speed (i.e. the average speed over an entire orbit) or its instantaneous speed at a particular point in its orbit. The maximum (instantaneous) orbital speed occurs at periapsis (perigee, perihelion, etc.), while the minimum speed for objects in closed orbits occurs at apoapsis (apogee, aphelion, etc.). In ideal two-body systems, objects in open orbits continue to slow down forever as their distance to the barycenter increases. 
When a system approximates a two-body system, instantaneous orbital speed at a given point of the orbit can be computed from its distance to the central body and the object's specific orbital energy, sometimes called "total energy". Specific orbital energy is constant and independent of position.
Radial trajectories.
In the following, it is thought that the system is a two-body system and the orbiting object has a negligible mass compared to the larger (central) object. In real-world orbital mechanics, it is the system's barycenter, not the larger object, which is at the focus.
Specific orbital energy, or total energy, is equal to "E"k − "E"p. (kinetic energy − potential energy). The sign of the result may be positive, zero, or negative and the sign tells us something about the type of orbit:
Transverse orbital speed.
The transverse orbital speed is inversely proportional to the distance to the central body because of the law of conservation of angular momentum, or equivalently, Kepler's second law. This states that as a body moves around its orbit during a fixed amount of time, the line from the barycenter to the body sweeps a constant area of the orbital plane, regardless of which part of its orbit the body traces during that period of time.
This law implies that the body moves slower near its apoapsis than near its periapsis, because at the smaller distance along the arc it needs to move faster to cover the same area.
Mean orbital speed.
For orbits with small eccentricity, the length of the orbit 
is close to that of a circular one, and the mean orbital speed can be approximated either from observations of the orbital period and the semimajor axis of its orbit, or from knowledge of the masses of the two bodies and the semimajor axis.
where is the orbital velocity, is the length of the semimajor axis, is the orbital period, and is the standard gravitational parameter. This is an approximation that only holds true when the orbiting body is of considerably lesser mass than the central one, and eccentricity is close to zero.
When one of the bodies is not of considerably lesser mass see: Gravitational two-body problem
So, when one of the masses is almost negligible compared to the other mass, as the case for Earth and Sun, one can approximate the orbit velocity formula_2 as:
or assuming equal to the radius of the orbit
Where is the (greater) mass around which this negligible mass or body is orbiting, and is the escape velocity.
For an object in an eccentric orbit orbiting a much larger body, the length of the orbit decreases with orbital eccentricity , and is an ellipse. This can be used to obtain a more accurate estimate of the average orbital speed:
The mean orbital speed decreases with eccentricity.
Instantaneous orbital speed.
For the instantaneous orbital speed of a body at any given point in its trajectory, both the mean distance and the instantaneous distance are taken into account:
where is the standard gravitational parameter of the orbited body, is the distance at which the speed is to be calculated, and is the length of the semi-major axis of the elliptical orbit. This expression is called the vis-viva equation.
For the Earth at perihelion, the value is:
which is slightly faster than Earth's average orbital speed of , as expected from Kepler's 2nd Law.
Planets.
The closer an object is to the Sun the faster it needs to move to maintain the orbit. Objects move fastest at perihelion (closest approach to the Sun) and slowest at aphelion (furthest distance from the Sun). Since planets in the Solar System are in nearly circular orbits their individual orbital velocities do not vary much. Being closest to the Sun and having the most eccentric orbit, Mercury's orbital speed varies from about 59 km/s at perihelion to 39 km/s at aphelion.
Halley's Comet on an eccentric orbit that reaches beyond Neptune will be moving 54.6 km/s when from the Sun, 41.5 km/s when 1 AU from the Sun (passing Earth's orbit), and roughly 1 km/s at aphelion from the Sun. Objects passing Earth's orbit going faster than 42.1 km/s have achieved escape velocity and will be ejected from the Solar System if not slowed down by a gravitational interaction with a planet.