WASHINGTON—President Biden’s re-election bid moved into a perilous stretch as allies and donors began looking to a future where a new candidate sits atop the ticket and data showed him losing in a landslide.

People close to top Democrats said Thursday that it now appeared it was a matter of when—not if—Biden bows out of the presidential race. In the past day or so, former President Barack Obama has told friends who have called him that Biden’s path to victory is narrow, according to people familiar with the calls.

Senior Democrats, including Senate Majority Leader Chuck Schumer (D., N.Y.), have indicated to some major donors that they are actively planning next steps should Biden decide to leave the ticket, people familiar with the discussions said. A Schumer spokesperson said many people have come to the leader with their ideas but that he hasn’t taken action on them.

Sen. Jon Tester became the second Democratic senator to call for President Biden to drop out of the race. Tester is considered the most vulnerable Democratic senator up for re-election this cycle, given that former President Donald Trump won Montana by double digits in 2020.

A detailed report compiled by Democrats showing the president forecast to lose in an Electoral College landslide has sent alarm bells through the party’s leadership and led to renewed calls publicly and privately for the president to drop out.

The data, which is based on thousands of voter surveys compiled by Democratic firm Blue Rose Research and viewed by The Wall Street Journal, shows Biden losing not only all the swing states, but also behind or even in New Hampshire, Minnesota, New Mexico, Virginia and Maine. It shows the president leading by only 2.9 percentage points in New Jersey.

A major concern for Democrats up and down the ballot is the fact that half of voters, including 28% of those who backed Biden in 2020 and 52% of swing voters, think Democrats in office have been lying about the president’s mental fitness. The report says voters are likely to view Democrats’ defense of Biden as dishonest by a two-to-one margin.

Though the data, which was shared widely with Democrats in recent days, found Vice President Kamala Harris performing better than Biden against Trump, it also shows that Republican attacks suggesting Harris wasn’t honest about the president’s health could be effective.

As Democrats look for a path forward, the findings showed that voters would want to see a competitive process to decide on an alternative nominee if Biden were to step aside.

Biden was holed up at his Delaware vacation home on Thursday after testing positive for Covid-19 the previous day. His frail appearance upon returning to Delaware and several stumbles in interviews earlier in the week sparked fresh concerns that he lacks the stamina and acuity to remain in the race and serve another term. Biden was on a course of Paxlovid to treat his Covid and experiencing mild upper respiratory symptoms, according to a letter from his doctor.

On Wednesday, Wall Street financiers and donors met in Manhattan and discussed not giving more money to any Democratic efforts until Biden ends his candidacy, people familiar with the meeting said.

Donors for the past two weeks, including in recent days, have been telling Schumer, House Minority Leader Hakeem Jeffries (D., N.Y.) and former House Speaker Nancy Pelosi (D., Calif.) that they won’t give or that they won’t raise money for the presidential or congressional races until Biden drops out, the people said, emphasizing that people are demoralized. Some have been increasingly insistent that the lawmakers publicly call on Biden to drop out and have been strategizing on whom else to speak with who might be able to persuade Biden.

Schumer met with Biden at the president’s beach house in Delaware last weekend, and he told the president at the meeting that the current election trajectory would cost Democrats the Senate.

“It seems like the obvious has become unavoidable: that Joe Biden is not strong enough to be the candidate that we need,” said Rep. Adam Smith (D., Wash.). “We have a better chance of winning with another candidate, and he should step aside, and the momentum seems to be heading in that direction.”

Citing wrestler Hulk Hogan’s appearance onstage at the Republican National Convention Thursday, Smith noted that Republicans, from the start of this campaign, have tried to cast the contest as strong man versus weak man. “So certainly this played into it, given Biden’s apparent failing health.”

West Wing aides say they have been kept in the dark about Biden’s intentions as the president’s inner circle has shrunk. But several, reached over the past 24 hours, are saying for the first time that Biden’s grip on power is more tenuous than ever, and it feels like the beginning of the end of his candidacy.

The view is shared by Biden allies who are detecting a new tone from the president’s inner core of aides. Steve Ricchetti, a longtime Biden adviser, initially was resistant to any polling or data showing Biden as a drag on the ticket. But in at least one recent conversation, Ricchetti has been more open and receptive to hearing a fuller assessment of the political landscape, according to a person familiar with the conversation.

“I sense that the campaign isn’t so virulent against the notion of a change,” said Rep. Mike Quigley (D., Ill.), who has called on Biden to step aside.

Biden spent the past few days campaigning in Nevada and gave several uneven interviews. In one, with Black Entertainment Television, he had difficulty immediately recalling the name of his secretary of defense, referring to him as the “Black man.”

Biden has weathered political storms in the past. He finished a dismal fourth place in the 2020 Iowa caucuses, then dropped to fifth place in the subsequent New Hampshire primary before staging a comeback. His party faced headwinds in the 2022 midterm elections, but fared better than expected.

“He is not wavering on anything” said principal deputy campaign manager Quentin Fulks during a news conference in Milwaukee on the sidelines of the Republican National Convention on Thursday morning. “The president has made his decision. I don’t want to be rude, but I don’t know how many more times we can answer that.”

Other defections that occurred Thursday include Rep. Jim Costa , a California Democrat. “For the good of the country, I think it is time for the president to pass the torch to the next generation to carry on the legacy he started,” he said.

Tester, in explaining his decision, said he had never been afraid to stand up to Biden when he is wrong. “And while I appreciate his commitment to public service and our country, I believe President Biden should not seek re-election to another term.”

In a four-page letter written over the July Fourth holiday, Rep. Jamie Raskin (D., Md.) urged President Biden to rethink his re-election campaign, comparing the president to a tired baseball pitcher. He didn’t explicitly call for the president to step aside, but his stance could carry broad influence in the party. The letter was obtained by the New York Times , and Raskin confirmed its authenticity via a text message.

“There is no shame in taking a well-deserved bow to the overflowing appreciation of the crowd when your arm is tired out,” wrote Raskin, who has played a key role in beating back the Republican attempts to impeach the president. “And there is real danger for the team in ignoring the statistics,” referring to hurler Pedro Martínez’s performance in a Red Sox-Yankees playoff game in 2003.

On Wednesday, the Biden campaign launched a 60-second ad across swing states targeting Donald Trump and his running mate , JD Vance, on abortion rights. It was the first new spot to go up since the campaign announced a pause in political advertising after the assassination attempt on Trump .

The Biden campaign noted there is a robust schedule in coming days, including a North Carolina rally that Vice President Harris headlined Thursday along with Gov. Roy Cooper. Second gentleman Doug Emhoff is set to appear at an event in Arizona on Friday.

Biden is scheduled to appear at fundraisers in California on July 26 and 27, and in Denver with Colorado Gov. Jared Polis on July 28, according to invitations viewed by the Journal. The campaign has also lined up fundraisers for Harris, first lady Jill Biden and other surrogates later this month.

Harris is expected to headline a fundraiser Saturday in Provincetown, Mass., and an event July 27 in Pittsfield, Mass., with performances by James Taylor, Yo-Yo Ma and Emanuel Ax. One of the hosts of the Pittsfield event is former Massachusetts Gov. Deval Patrick . The first lady is scheduled to attend three fundraisers in Massachusetts and Maine in late July.

Write to Annie Linskey at annie.linskey@wsj.com , Emily Glazer at Emily.Glazer@wsj.com and Tarini Parti at tarini.parti@wsj.com