A US president cannot run for the office of president after having completed two terms (either full terms or partial terms).
However there is no law preventing a former president seeking any other type of office. Hence an ex-president could (in theory) run for a seat in the House of Representatives, the Senate, or for any state office such as Governor. John Quincy Adams is the only former president to have served in Congress after his presidency.
Interestingly, it might be possible for a former President to run for the office of Vice President. This would seem strange, given that the Vice-President is expected to replace the President when necessary, and would thus seem to be in violation of the "no more than two terms" rule.
However there is a theoretical loophole due to the wording of the 22nd amendment. The 22th amendment only prevents an ineligible ex-president from being again elected to the office of President. It does not specifically rule on the situation where a former president is elected to the vice-presidency and subsequently "ascends" to the office.
This circumstance has never arisen so it has not yet been tested in the law. In the case a former president decided to run for the Vice-Presidency it would be very likely that a Supreme Court case (and possibly a revised constitutional amendment) would follow.
For the record, former President Clinton rejected the idea on the David Letterman Show in 2007, saying "...I just don't believe it's consistent with the spirit of the Constitution for someone who's been President twice to be elected Vice President."