It's All About the Angle
The main difference between joint extension and flexion is whether the angle between two body parts increases or decreases during the joint's movement. In general, when you extend or straighten a joint, the angle increases, and when you flex or bend a joint, the angle decreases.
Extension and Flexion Examples
Hip flexion takes place when you bend forward at your waist to touch your toes -- the angle between you upper and lower body decreases. When you return to an upright position, hip extension occurs -- the angle increases. To kick a soccer ball, for example, you flex your knee joint as you take your foot backward to prepare for the kick. The joint then extends as you move your lower leg forward to kick the ball.