Prior to 1973, the rules of Major League Baseball stated that each player had to bat in his spot in the order. This meant that pitchers didn't get to bat every day like other players, as they only took the field every four or five days at most, and so were usually not very effective hitters. (Babe Ruth was one notable exception; he began his career as a pitcher for the Boston Red Sox.) That year, in an effort to combat both declining attendance and declining offense, the American League adopted a rule stating that a team could designate a hitter to bat for the pitcher. This changed the game in several ways; pitchers went deeper into games because they didn't need to be lifted for a pinch hitter, the double switch became unnecessary, and older players whose careers and skills were on the wane had a chance to play for an extra year or two. George Brett, Carl Yastrzemski, and Paul Molitor were all able to extend their careers as designated hitters.
A team that uses the designated hitter rule has, in general, two options on how to use designated hitters. They can either rotate the DH spot among players in the lineup so as to give the players a bit of a rest without removing them from the lineup, or they can employ a full-time designated hitter. Edgar Martinez of the Seattle Mariners falls into the latter category; he came up as a third baseman but has not played a field position in several years due to problems with his legs (and the fact that he was always a much better hitter than he was a third baseman).
There is a great deal of controversy about whether the designated hitter rule should be continued. Purists complain that it breaks up the symmetry of the game; advocates like the increased offensive output. Whether one is in favor of or against the designated hitter rule often depends on whether their favorite team is in the American League (which uses the designated hitter) or the National League (which doesn't). Many baseball fans feel that Martinez deserves to be in the Baseball Hall of Fame, but whether he will be voted in by writers who feel that the designated hitter is anathema to baseball remains to be seen.
Another controversy surrounding the designated hitter rule is that since American League pitchers do not have to go to the plate and bat, they may be more likely to intimidate opposing batters with inside pitches, knowing that they personally will not not have to enter the batter's box and deal with possible retaliation from the opposing pitcher.
When games are played between American League and National League teams (such as during interleague play or in the World Series), the rules of the league of the home team are the ones followed. Thus, when a National League team plays in an American League ballpark, the team receives the benefit of a more experienced hitter in its lineup batting instead of the pitcher. Conversely, when Amaerican League teams play in a National League ballpark, they lose the advantage of their more experienced designated hitter in their regular lineup.