The driver and woods should be used for long distances or off the tee, and irons should be used from intermediate distances from the fairway or the rough. Wedges should be used from short distances or a sand trap, and putters should be used from the green or just off the green in the short rough.
Both the driver (sometimes referred to as a "1 wood") and fairway woods are great for long distance because they have a large head, which produces powerful shots and low loft that result in long rolls when landing on a fairway. Irons and wedges have a higher loft that results in less bounce, perfect for an approach shot at the green.
Pure distance between the ball and the hole is not the only condition that should be taken into account when selecting a club; if there is an obstacle in the way of the hole, then a smaller club is often used to produce a lay up shot short on the obstacle. If the hole is elevated, a stronger club is often used to get the ball to the green than what would normally be used from the given distance. Wind is also a factor when selecting a club since shots with lower loft are less affected by the wind.