Jessica Rojas beat poverty to put herself through engineering college, where she collected accolades for academic achievement. After graduating last year, Ms. Rojas, who grew up in Chicago, was hired by a utility company to help modernize the city’s electrical grid.

But her life could soon be upended in a showdown over a five-year-old initiative, Deferred Action for Childhood Arrivals, or DACA, which has granted permission to stay and work to about 800,000 immigrants like Ms. Rojas who were brought illegally to the United States as children.

Since attacking DACA on the campaign trail, President Trump has pledged to keep the program alive, calling recipients, also known as Dreamers, “absolutely incredible kids” who deserve compassion. But in recent days, key players in his administration have advised Mr. Trump to wind down the program, and his attorney general, Jeff Sessions, has informed him he considers it unconstitutional and cannot defend it in court, according to people familiar with the discussions who insisted on anonymity to describe private deliberations. While the White House has declined to comment on the fate of DACA, several officials and people briefed on the discussions now say the president is on the brink of ending it, although they note that Mr. Trump often changes his mind.

Mr. Trump has been pondering — and publicly agonizing over — what to do about the program since he took office. But discussions about it inside the White House took on new urgency after a group of conservative state attorneys general threatened to sue the Trump administration in federal court unless it begins to dismantle the program by Sept. 5.