The extrapolation controls let you modify the shape of an fcurve before the first key and after the last key. Extrapolation extends the curve's ends based on the position of these two extreme points.
To apply extrapolation to a curve:
Choose Curves Constant Extrapolation or Curves Gradient Extrapolation from the fcurve editor toolbar.
For spline interpolation, the slope of the first or last key is used. This results in a continuation of the motion at the same speed.
Constant extrapolation flattens the curve after the end points, adding no animation. It extrapolates the value of the Y axis from the first frame to the first key, and the value of the Y axis from the last key to the last frame. This results in a hold of motion before and after the movement.
With constant extrapolation, the values before the first keyframe and the values after the last keyframe remain constant.
Gradient extrapolation makes the curve continue in the direction of (tangent to) the end keys' slope handle angle. It extrapolates an increment based on the first key's slope orientation and applies it from the first frame to the first key. Then it extrapolates the increment calculated between the last and previous-to-last keys and applies it from the last key frame to the last frame. This has the effect of the curve continuing on this slope indefinitely.
With gradient extrapolation, the values before the first keyframe and the values after the last keyframe are determined by the slope. Note the slope handles' relation is tangent to the extrapolated values.