It happened in the 1960 Presidential election between John F. Kennedy and Richard M. Nixon. Some historians say it changed the course of the election and history, though we'll never know for sure if that's true, or what the exact effect with voters was.
Kennedy was young, attractive and vibrant, the voice of a new generation, a new direction. Nixon represented the experience of the past, of anti-communism and the 1950s.
The debate was a good one, with Kennedy giving more eloquent and smooth answers, while Nixon had more experience. The main effect we know of was that voters who listened on the radio tended to vote more for Nixon. People who saw the debate on television tended to vote for Kennedy. That is the visual of Kennedy contrasted with Nixon's age and appearance made JFK seem a better choice.
Did it change the outcome of the election? Hard to say, but the difference in the popular vote between the two was a mere 118,000, and 46 million Americans watched the TV debate.