Mr. Ballesteros said his parents, sensing the hostility toward undocumented immigrants already rising during the Obama administration, returned to the Philippines in 2015.

Without family, his fellow teachers are his support network, and they meet weekly for food and drinks. Lately, it has been a somber affair.

Many of Mr. Ballesteros’s students in East New York are from Caribbean immigrant families, and he has shared his own story with them since classes started. He declined to give the name of the school because of his uncertain legal status.

“I don’t teach to talk about the contraction of gas particles,” he said. "I teach because I see so much of myself in my students and I know that my students see little bits and pieces of their own story in mine.”

Mr. Ballesteros’s work permit expires in July 2019, and as of the Tuesday announcement, DACA recipients would be covered until the end of their permits. That gives him two years to stay in the classroom, but puts his goal of graduate school for a career in education policy or administration on hold. “DACA allowed me to dream and think,” he said. “Right now I can’t think past July 2019.”

Those wanting to go into the classroom feel just as deflated. Areli Morales, 21, is in her senior year at Brooklyn College, training to become a bilingual education teacher. She earned a scholarship through a TheDream.US, a nonprofit offering grants to more than 3,000 first generation Americans whose legal status as DACA recipients prevents them from getting federal aid for college. Ms. Morales is one of 720 current students throughout the City University of New York system with these scholarships, according to the university.