ATLANTA—President Biden’s halting performance against Donald Trump on Thursday left the Democratic Party in turmoil, with officials trying to sort through the president’s prospects after an appearance in which he stumbled over words, stammered through many answers and elevated widespread voter concerns that he is too old to serve.

For months, many Democrats have argued that the 81-year-old president is fit for a second term. But following the debate, some Democratic strategists, donors and advisers to donors said they were shocked by Biden’s showing , which they said had spurred private discussions about replacing him on the presidential ticket . They acknowledged, however, that the chances of the president withdrawing remained slim.

One Biden ally said he had to turn off the TV several times. Another said Biden’s performance made even Trump, 78, who repeated falsehoods throughout the 90-minute event, look like a statesman. Some also expressed concerns about the effect the debate would have on Biden’s fundraising at a time when Trump is poised to wipe out the president’s financial advantage .

“I’m very worried,” said one Democratic lawmaker, adding that constituents don’t like Trump but were shaken by Biden’s performance. “I’m on my knees praying it’s not too late to replace him. This was so avoidable,” the lawmaker said.

Another Democratic elected official said that many Democratic members of Congress were panicked after the debate, saying that some, including those loyal to the White House, want a new nominee.

“ Joe Biden had one thing he had to do tonight and he didn’t do it,” former Sen. Claire McCaskill (D., Mo.) said on MSNBC. “He had one thing he had to accomplish, and that was reassure America that he was up to the job at his age. And he failed at that.”

Several advisers to prominent Democrats seen as potential presidential candidates in 2028 received messages from donors expressing their concerns about the president’s showing, according to people briefed on the discussions.

If Biden were to withdraw before the Democrats’ national nominating convention in August—which remains a remote possibility—it would raise the prospect of an open convention, in which delegates would be free to abandon commitments made to Biden during the primary elections and to back a new nominee. If he were to withdraw after the convention, a special meeting of the Democratic National Committee would decide the party’s presidential ticket, according to the DNC’s rules.

Biden dismissed concerns about his debate performance and calls for him to drop out. “I think we did well,” he told reporters during a stop at a Waffle House after the debate.

“It’s hard to debate a liar,” Biden added, referring to Trump.

A Biden adviser said that the campaign never expected the race to turn on one event or one night and that it will continue to make efforts to break through with a largely locked-in electorate. The adviser also said Biden’s circle is used to being counted out, noting that the president at one point faced calls to exit from the 2020 Democratic primary. “Of course Joe Biden is not dropping out,” the adviser said.

Biden’s campaign also argued that Trump’s performance was a turnoff to the independent voters who could decide the election, citing their own survey of voters in a Midwestern state. The campaign said that 11 p.m. to midnight Thursday was the best grassroots fundraising hour of the campaign.

For many voters, the debate was likely to have been the first real exposure to Biden in recent months, given that he has kept a relatively muted public presence and that many voters pay little attention to politics. The onstage contest between two men who have served as president was likely to be the first event prompting less-interested voters to tune into the campaign.

Some undecided voters said they were stunned by Biden’s demeanor.

“I was like, holy crap, he doesn’t have a whole lot of life or vigor in him—not for the most powerful man in the free world,” said Roman DeWitt, 27, of Phoenix. “It was rough watching an 81-year old man up there.”

DeWitt, who voted for Biden in 2020 and described himself as “very left leaning,” said he would never vote for Trump. But he remains undecided on whether he would cast a ballot for Biden in November. “A vote for Biden is just a vote for the vice president,’’ said DeWitt, who said he doesn’t support Vice President Kamala Harris . “I’m just not confident in Biden’s ability to really make it another four years.”

Laura Eklund, 49, of Elko, Nev., said she was surprised by how much Biden’s age showed during the debate.

Eklund—a Republican who has supported Democrats in the past and is undecided about how she will vote in November—said that if Biden were her father, “I would probably ask him not to proceed. His overall appearance has substantially changed. He stuttered before in the past, but not like he did this time.”

But Eklund, a health and safety manager for an exploration drilling company, said she wasn’t happy with Trump’s performance either. “I felt they both acted like children, unfortunately,” she said.

Polls have consistently found that voters believe both Biden and Trump are too old to serve as president, but that more feel Biden isn’t up to the job. Nearly three-quarters of voters said in a Wall Street Journal survey in February that Biden is too old to run for the presidency, and more than half said so of Trump.

One Biden donor called the president’s performance “very disappointing and disturbing,” adding it was “hard to understand.” The donor said it was so different from Biden’s vigorous State of the Union address . “Just can’t figure it out,” the donor said.

Some large-dollar Biden donors expressed concern about his debate showing. One donor said there were increasing worries that Biden looked and sounded too old. Another said it was so bad they didn’t want to talk about it. A third referred to it as “awful.” A fourth said: “He was so bad.”

Still, some of the large donors were skeptical the Democrats would make a dramatic change so close to the election. One of the donors said the Democratic Party is “too committed to him at this point to pivot.” A different one said: “It’s hard. There’s nothing anyone can do.” Another Democratic donor said that Biden should step aside to let another Democrat run, but predicted that the president wouldn’t do so.

Republicans said that Biden’s performance was so disturbing that their concern transcended partisanship.

“It’s over,” said Mark Harris , a Republican political consultant in Pennsylvania. “It’s over. Either Democrats replace him, or he’s going to lose the election … Joe Biden cannot win this election.”

Harris added, “I think for a lot of Americans, it’s now clear that Joe Biden cannot execute the duties of the president. I legitimately am worried that he’s not capable of being president though January, let alone for another four years.”

By contrast, Stuart Stevens, a top strategist for 2012 GOP nominee Mitt Romney , disputed the idea that the debate had damaged Biden’s standing. Stevens, who is now with an anti-Trump group, the Lincoln Project, said that former presidents George W. Bush and Barack Obama lost ground in opinion polls after the first debates of their re-election campaigns but went on to win.

“I’d rather be Biden than a guy from Queens out on bail, bragging about overturning Roe v. Wade and defending Jan. 6,’’ said Stevens, referring to Trump and the 2021 Capitol riot . “Trump didn’t reframe his candidacy, and I think that’s the essential thing.”

Democrats didn’t immediately come down to the spin room in Atlanta where top surrogates gather after the debate. When they did, they spoke for less than 15 minutes and took a few questions about Biden’s performance on the debate stage.

California Gov. Gavin Newsom , a Democrat, was asked repeatedly whether he would consider replacing Biden on the ticket. He said that he didn’t believe the party should change nominees. “Our nominee is Joe Biden, I’m looking forward to voting for him in November, he’s going to be our nominee,” he said, trailed by reporters as he walked through the spin room.

“You don’t turn your back because of one performance,” Newsom said during an MSNBC TV interview. “What kind of party does that?”

—Ken Thomas, Natalie Andrews, Siobhan Hughes, Tarini Parti and Emily Glazer contributed to this article.

Write to Aaron Zitner at aaron.zitner@wsj.com , Catherine Lucey at catherine.lucey@wsj.com , Annie Linskey at annie.linskey@wsj.com and Andrew Restuccia at andrew.restuccia@wsj.com