I would agree that this is more of a question of protocol than language, but I suppose it is an example of how usage changes, and formal protocol and "polite" language deviate.
The traditional rule is that for offices held by a single person at a time (e.g. president, governor, mayor), a title should only be applied to the current office holder. If the office or rank is held concurrently by multiple people (e.g. judge, professor, and military ranks — although usually only for senior officers), the designation is retained for life.
Once out of office, the individual reverts to whichever title or honorific applied before he or she held office, although as a courtesy, "once an Honorable, always an Honorable." Thus, Governor Howard Dean of Vermont, "by the book," became upon retirement Dr. Howard Dean, and would be addressed as Dr. Dean, but might be introduced as The Honorable Howard Dean, former governor of Vermont. President Jimmy Carter became Mr. Carter (or even Lt. Carter, although ranks of retired military are usually applied only for senior officers). As far as I can tell from perusing other official governmental protocol guides, this remains the formal practice in the U.S.
In common practice, very high officials such as the U.S. president have been granted a "courtesy title" for many years now, and the "courtesy title" is trickling down. Living just outside Washington, I tend to blame commentators on 24-hour television news networks trying to secure interviews from former public officials by feeding their egos, and wish I could think of a more elegant phrase than "obsequiousness escalator" to label it.
Not a few columnists and bloggers have expressed indignation over the extension of courtesy titles, with more than a few indisposed to extend the courtesy to "Speaker" Newt Gingrich.
I'll add a quote from a U.S. Department of State diplomatic protocol guide
Over the years, and recently as well, there has been discussion about the use of the honorific title of Ambassador by former ambassadors, both those who remain active in the Foreign Service and those who are retired. For years, Department regulations have forbidden this usage unless actually in the job of ambassador or for those few who retired with the personal rank of career Ambassador.
For current employees, long-standing custom and practice, however, has established a clear tradition in the Department and in the Foreign Service that persons who have served a ambassador after Senate confirmation may continue to use the title after such service in appropriate communications with others, may be referred to in communications and conversations by the title of Ambassador, and may be introduced to public audiences by the title.
The Department has also clarified the use of the title for persons who have retired from the Foreign Service or left government service who served as ambassador after Senate confirmation. An amendment to the various regulations permits the use of the title, “Ambassador, Retired,” for all such persons.