There are typically five different kinds of shaft flex that you can choose from: regular (R), stiff (S), extra-stiff (X) senior (A), and ladies (L).
The goal should be to select a shaft flex that will help you attain the most efficient combination of launch angle, distance, and accuracy. Two extremely important factors are your swing speed and your tempo. Generally, faster swing speeds require stiffer shafts. Fast tempo players tend to select shafts that "load" and "kick" more quickly, whereas slower tempo players often benefit more from a shaft that loads (flexes) more slowly.
Regular and Stiff Flex Shaft
Players with swing speeds between 85-90 mph (typical of beginning male amateurs and many senior players) will tend to select a club with a regular flex shaft. The middle ground between regular and stiff lies generally in the range of 90-95 mph swing speeds. Fortunately, manufacturers today produce shafts that are considered a "weak stiff" or a "strong regular", and offer a wide variety of shafts that allow a more customized fitting.
Players with swing speeds between 95-100 mph tend to gravitate towards stiff shafts, with 105 mph being the point at which some players begin to use x-stiff (extra stiff) shafts, particularly in their drivers. Golfers with swing speeds above 105 mph, and most PGA Tour players fall in the range of 108-120 mph, find that the x-stiff shafts help to increase accuracy, but also help to achieve a more penetrating ball flight, particularly with the irons.
Senior and Ladies Flex Shaft
You can also determine what kind of flex you should be using by how far you can hit a ball using a driver. Usually, if it's under or around 180 yards you should use senior flex. If it's around 200 yards, you'd probably do well with ladies flex. Both of these are best suited for those with high handicaps. If you can hit the ball 225-250 yards then you are in the normal flex range. This is one of the most commonly used ones, and it appropriate for mid-high handicaps. Also common is the stiff flex, which is intended for golfers who can hit an average of 250-300 yards. It's good for those with a mid-low handicap. Most people (unless you are a professional) use those four kinds of flex shafts, but if you can hit over 300 yards, then you can use an extra-stiff flex. It also depends on your swing speed - those with a faster swing speed typically are more suited in using a stiff or extra-stiff flex shaft.