As snow swirled down after midnight on Tuesday, about three dozen migrants, including two families with children, huddled on the sidewalk under thin blankets outside a city office in Brooklyn.

They had temporarily left their homeless shelters to spend the night camping in the 20-degree wind chill for a chance at a prize whose significance was not quite clear: a New York City-issued identification card called IDNYC.

Some said they had been told by shelter workers that the card was a necessary step on the road to legal employment. One woman who was six months pregnant said she had heard she needed the card to get seen at a public hospital.

As winter settles in, the situation faced by the 68,000 migrants in city shelters has grown more precarious and left many eager to find their way to self-sufficiency but confused about the many rules that govern the steps to get there.

Jimmy Darwin, 26, from Peru, had a spot near the front of the line. He had arrived at 7 a.m. Monday and built a little house for his 9-year-old daughter and his wife out of cardboard boxes and a suitcase.

“They told me I need the city ID first, so then I can start the application for the work permit,” Mr. Darwin said.

Last week, the city began issuing eviction letters to families approaching the 60-day limit on stays at any one shelter. They will have to reapply if they want to continue to take advantage of the city’s unique “right to shelter,” which requires it to offer beds to every homeless person.

But several migrants said that they were told differently at the migrant processing center at the Roosevelt Hotel in Manhattan. They said workers told them that after another 60 days, migrant families would be kicked out of the system altogether. “They told us that this is our last chance, we have 60 days and that’s it,” Gracia Ekwa, a father of three from Angola, said on Saturday.

Lorena Garcia, who journeyed from Colombia with her 3-year-old son, said shelter workers told her that “after the 60 days, I have to leave there and pay rent.” She said she did not know how she would find an affordable room.

A city spokeswoman, Kayla Mamelak, said that every family who has reapplied for shelter has received it. She added that if families can’t find housing after the second 60-day period, the city will do everything in its power to offer them shelter beds.

The mounting uncertainty comes as the state and city governments grapple with the cost of the crisis. On Tuesday, Gov. Kathy Hochul announced a state budget that includes $2.4 billion to help New York City with migrants, a $500 million increase over last year. Last week, New York City’s mayor, Eric Adams, reduced the projected three-year cost of housing and feeding the migrants by 20 percent, to about $9.6 billion, down from $12 billion, in part by spending less on services for them.

Appointments to apply for the IDNYC card book up immediately, but the office on Third Avenue in the Boerum Hill neighborhood takes some walk-ins, and those are the spots the migrants hope to secure. The city provided no way to hold their places in line, so the migrants had made their own list on a scrap of cardboard and wedged it into the locked door of the building.

A little before 1 a.m. on Tuesday, City Councilman Lincoln Restler, whose district includes the building that houses the IDNYC office, brought over a bag of blankets and was surrounded. Some people grabbed blankets from others, who yelled and cursed. A few took more than one blanket and dashed back to their sleeping spots.

Mr. Restler said that dozens of people have slept outside the office for more than a week.

“Folks are just so desperate to work that they will do anything they possibly can to help in whatever they think might increase their chances,” he said.

The city says that it issued 50 percent more IDNYC cards in 2023 than in 2022, but whether they can even help migrants get work is murky.

“IDNYC does not provide work authorization and does not impact immigration status,” Neha Sharma, a spokeswoman for the Department of Social Services, said in an email. “We continue to work to address any misconception around this.”

Noah Habeeb, immigration clinic director at the Ark at Congregation Beit Simchat Torah in Manhattan, which helps migrants defend themselves in immigration proceedings, said that an IDNYC card could help someone applying for work authorization, but only in limited cases that don’t apply to most migrants.

Many migrants outside the IDNYC office had never seen snow. “It’s very cold, but it makes me happy,” said Joshua Carbonett, 11, who had come from Venezuela with his family. “In my country, snow does not fall.”

Vicendel Rodríguez, 29, drew “Venezuela” in snow on a car and a heart below it. Then he pivoted.

“Do you have any work?” he asked a reporter. “Do you have any contact for a job? Anything?”

Chelsia Rose Marcius, Wesley Parnell and Dakota Santiago contributed reporting.