He left his position in the White House to run in a special election in California.
Apparently in real life, Robert Lowe left the show after the network began meddling with his character, and the other lead characters received raises (while he didn't).
In the TV show The West Wing Sam left during the 4th season. He ran in a special election in California. He was replaced by Will Bailey.
West Coast Wing was created in 1942.
No Exit - The West Wing - was created on 2004-04-28.
Holy Night - The West Wing - was created on 2002-12-11.
Separation of Powers - The West Wing - was created on 2003-11-12.
The show ran for 7 seasons between 1999-2006.
The White House
The duration of West Wing Week is 420.0 seconds.
West Coast Wing was created in 1942.
The West Wing was created on 1999-09-22.
Shibboleth - The West Wing - was created on 2000-11-22.
Tomorrow - The West Wing - was created on 2006-05-14.
The Ticket - The West Wing - was created on 2005-09-25.
Han - The West Wing - was created on 2003-10-22.
Freedonia - The West Wing - was created on 2005-02-16.
Game On - The West Wing - was created on 2002-10-30.
Noël - The West Wing - was created on 2000-12-20.
An Khe - The West Wing - was created on 2004-02-18.