The relationship between Josh Lyman and Donna Moss evolved slowly. They first met during Jed Bartlet's campaign. After the election, she served as Josh's assistant for years in the White House. The two often casually debated policy issues, with Josh voicing the Democratic party line and Donna voicing the kind of questions the typical voter might have.
They also constantly flirted with one another. They have the whole red light scene where Donna says if Josh was in an accident she wouldn't stop for red lights.
As time went on it became clear that they cared deeply for one another: When Josh was shot (Season 1, 2) Donna went to his house every day to take care of him and bring him food, even restricting Josh's workload and preventing other staffers from coming until he got better, and Donna was the one who noticed Josh's symptoms of post-traumatic stress disorder. When Donna was injured by a roadside bomb in the Middle East, (late Season 5, early 6) the normally workaholic Josh dropped everything and stayed with her at the hospital in Germany. Josh brought Donna red roses, then found her gone (she had a blood clot.) Amy Gardner noticed that Donna stayed as Josh's assistant without promotion and without exploring other opportunities that had opened up through years of being a White House insider.
After Donna quit as Josh's assistant, ("Impact Winter",) Josh was extremely upset and often found himself at odds with her since she had taken a job with the Russel campaign. In "The Ticket", Donna goes to Josh asking for a job as his deputy after Russel lost the nomination. He appears as if he wants to but thinks he shouldn't because of Donna's previous job, telling her, "I've got an airplane hangar out there filled with 500 strangers looking to me for direction; I've got a candidate who doesn't trust any of them and frankly neither do I, and if you think I don't miss you every day..." Donna is eventually hired by Lou as a spokeswoman to speak out against the attack ad on the Santos Campaign ("The Al Smith Dinner.")
When Donna brings Josh good news about some polling information showing that they are tied with Vinick, ("The Cold",) Josh kisses her, later saying that it was "inappropriate," but Donna disagrees, telling him that "it was bound to happen sometime." C.J. and Will Bailey later pick up on this, with Will telling her that it isn't inappropriate, after figuring out that "yours is Josh. You're not cryptic."
After sleeping with each other for a few weeks, they have issues defining their relationship. Donna gives Josh an ultimatum, saying that if they can't decide what they want their relationship to be in four weeks, then they clearly don't belong together.
When Sam Seaborn joins the campaign he forces Josh to go on a vacation and Josh asks Donna to join him. Several months later, on the morning of Santos' inauguration day, Josh and Donna wake up in bed together. From this, we can infer that they will be together for the long haul.