Ronald Reagan and President Carter agreed yesterday to a nationally televised debate that could be the critical event of the 1980 campaign.

The League of Women Voters invited the two candidates to a debate in Cleveland on Oct. 28, but it was not clear whether this would be the place and date of the only debate this year between the major party presidential contenders.

James A. Baker III, Reagan's negotiator on debates, said details would be worked out at a meeting schedule for 11 a.m. Monday at the league's office here. The president's campaign chairman, Robert S. Strauss, said Carter is willing to debate his Republican opponent under "any reasonable" circumstances.

In issuing its invitation, the league excluded independent candidate John B. Anderson, who participated in an earlier debate with Reagan. At the time, his rating in most national polls was about 15 percent. Since then, Anderson has dropped to below 10 percent, and league officials said earlier this week that they would reevaluate his candidacy to see it if is "viable."

Reagan's decision to agree to debate Carter without the presence of Anderson represented a risky "roll of the dice" by his political strategists, who concede that the GOP nominee's lead over the president is dangerously thin in a number of key states. But the confrontation will hold risks for both candidates and, in any event, is likely to set the tone for the final days of the campaign when a large bloc of undecided voters will make up their minds.

In a statement he read to reporters before departing from New York's LaGuardia airport, Reagan said he was "eager to debate the critical issues of the presidential campaign with Jimmy Carter."

Even while agreeing to debate Carter, Reagan said he still favors Anderson's inclusion.

"Measured by his present support and resources, Congressman John Anderson should be included in that debate," Reagan said. "Mr. Carter should do what's right and fair, and I will leave to his conscience and the judgment of the American people whether Mr. Carter should meet Mr. Anderson."

[Campaigning in Calfifornia, Anderson said, "I think it's highly unfortunate that the League of Women Voters has knuckled under to the White House." He said he would attempt to purchase time from at least one of the networks either before or after the televised Carter-Reagan debate.]

From the outset, Reagan strategists have been eager to keep Anderson as a viable presidential candidate because surveys show him taking more votes from Caarter than from Reagan. It was for this reason that Reagan originally refused to participate in any debate from which Anderson was excluded.

But in the last week, Reagan's surveys have shown Anderson declining. While the same surveys show Reagan with a lead in enough states to win a majority of the electoral vote, they also show a large undecided vote and some softness in Reagan's support, particularly among voters who are worried about the possibility of war.

So, after long strategy sessions with his key advisers, Reagan decided that the best way to answer doubts about him on the peace issue was to debate Carter.

For the Carter strategists, Reagan's decision to debate represented a gamble they have won, at least so far. Fearing the impact of Anderson's candidacy, the president has refused to engage in a three-way debate involving Anderson unless Reagan first met him in a "one-on-one" encounter. He was willing to be criticized for boycotting the Reagan-Anderson debate in Baltimore last month while gambling that a decline in Reagan's lead before Election Day Nov. 4, eventually would force him to accept his terms and leave Anderson standing on the sidelines.

From the outset of the campaign, the Carter aides have insisted that they wanted as many debates with Reagan as possible and, deriding Reagan's grasp of the complexities of national issues have appeared supremely confident that the president would best his opponent.

However, in the only face-to-face encounter between the two candidates during the campaign, Reagan was the clear winner. This occurred Thursday night at the Alfred E. Smith memorial dinner in New York where the two men spoke. Reagan used a light, self-deprecatory touch that constrasted with a Carter speech that was more openly a campaign pitch. The audience responded far more warmly to Reagan than to the president, which heartened the Reagan camp.

"If he [Reagan] can repeat what he did in New York Thursday night, there's no question who will win the debate," said a Reagan aide.

The prevailing view in the Reagan camp was that the debate would probably be the decisive event in the campaign and that it would overshadow the next week's campaigning of both candidates.

But the Reagan side is not leaving the resolution of the "peace issue" to the debate alone. On Sunday at 10:30 p.m. EDT, Reagan will make a half-hour speech on the CBS network that will give his views on war and peace issues.

Reagan's decision to meet Carter face-to-face was arrived at in two strategy sessions at the Waldorf Astoria Hotel in New York involving the GOP nominee and his top advisers.

Before he left for Chicago today, Reagan was asked why he decided to "gamble the lead all your people say you have on this one debate with Mr. Carter?"

"Because I've always said that I'm willing to debate," Reagan replied. "Mr. Carter's the one who's ducked every debate, and that goes through his whole political caraeer. He's reneged on every debate, including his gubernatorial race. And in this campaign, also. But I said from the beginning that I think the people have a right to hear us and see us. But there was a candidate [Anderson] that was judged to be viable . . . and I felt he should be in those debates, also. I have debated six times already -- and, maybe it's the lucky seven."