With winter ahead, and the influx of migrants continuing unabated, New York City is set to enter a potentially perilous new phase in a crisis that has already overwhelmed homeless shelters.

Last week, as temperatures dipped below freezing, dozens of immigrants hailing from much warmer climates opted to sleep on city streets in Lower Manhattan as they waited for beds.

Migrant families sleeping on military-style cots in giant winterized tents have complained about drafts of cold air keeping them awake at night.

As colder weather approaches, some elected officials and advocates worry such scenes could worsen. Officials are bracing for the challenge of sheltering the 66,000 migrants scattered across city shelters, many of whom arrived in New York without adequate winter clothing and drastically unprepared for harsh northeastern winters.

Many families with children face a deadline shortly after Christmas, when they will reach a 60-day limit imposed by the city, after which they must reapply to stay. City officials have said they will have to leave the shelters to reapply for beds.

The images last week of migrants sleeping outside a former elementary school in the East Village where they hoped to sign up for shelter drew comparisons with scenes over the summer when people huddled on sidewalks outside of a homeless intake center in Midtown. But this time they had to brave bone-chilling temperatures.

Homeless men from as far away as Mauritania and Venezuela waited for hours outside, over several days, shivering under bundles of blankets as they waited to reapply for a bed in a city shelter after reaching a 30-day limit imposed earlier this year on single adults staying in shelters.

City officials have hoped the policy would encourage people to find housing elsewhere — or to leave town. Fewer than 25 percent of the 20,773 migrants who had reached the 30-day limit as of Nov. 26 had returned to a city shelter, officials said. Even so, a number of single men reapplied for beds last week, straining the system.

Many migrants showed up outside the school, St. Brigid, a closed Catholic school near Tompkins Square Park, with backpacks and small suitcases, and waited all day without being seen by a city worker. Even when the school building opened, they were made to wait outside in the cold.

Many were ultimately turned away and told to try again the next day. The city directed the migrants to a waiting room in a Bronx shelter where they could spend the night on the floor, but some decided to sleep outside the East Village school, on makeshift mats of flattened cardboard, to secure a good spot in line the following day.

“They assign me a number, but never get to my number, so I have to start the process all over again the next day,” said Marco Faz, 43, from Ecuador, who slept at the front of the line on Thursday morning as he waited to get a bed after moving out of a Queens shelter last Monday.

Over the past several months, the influx of migrants has led city officials to erect massive tent dormitories where thousands of people are now staying. The tents are equipped with heating systems, but as the cold has set in, some migrants said they were struggling with the cold. Families said they were sleeping with layers of clothes on and wrapping themselves in used blankets left behind by others.

“You can’t even sleep,” said Luis Beltrán, a 32-year-old from Venezuela who has been living at a Randall’s Island shelter since late August. “At night you keep waking up because the cold gets into your bones.”

The cold-weather scenes have crystallized the alarming strain that the arrival of more than 140,000 asylum seekers since spring last year has placed on the city. The influx has prompted the city to spend more than $2.1 billion and open 210 emergency shelters, even as Mayor Eric Adams continues to warn that the crisis could soon spill over into the streets.

Other troubling scenes are unfolding in other northern states and cities. In Chicago, migrants have been sleeping in buses and on the floor of police stations, while Massachusetts has warned that its shelter system had reached full capacity. The hazards of exposing migrants to the elements have injected a sense of urgency into the pressure campaign by local leaders, including Mayor Adams, who are calling on the federal government to do more.

City Hall has said budget constraints mean it will have to cut spending on migrant care soon. Anne Williams-Isom, the deputy mayor leading the city’s response to the crisis, said during a news conference last Tuesday that New York was at capacity.

“We’re running out of staff, we’re running of money, we’re running out of space,” she said.

But advocacy groups argue that migrants are being sent on a dizzying and unnecessary citywide shuffle that is sowing confusion and disrupting any sense of stability they may have achieved.

Joshua Goldfein, a staff attorney for the Legal Aid Society, a party in the court case that led to the mandate requiring the city to offer shelter to anyone who asks for it, said it remained unclear if the recent fiasco was the result of bureaucratic breakdowns or a true lack of beds.

On Wednesday, after news reports highlighted the situation, the city appeared to iron out some of the operational issues and allow migrants to wait for their turns inside St. Brigid. Most migrants interviewed last week said they were eventually reassigned a bed, even if it took several days.

Andres Ampies and his brother, both from Venezuela, spent Wednesday night shuffling between the school sidewalk and the relative warmth of the restrooms in Tompkins Square. They were looking to secure another bed after their 30-day stay at a tent dormitory in Queens ended. Being forced out of the shelter, they said, had put in limbo the English classes and workplace training sessions for construction jobs they were scheduled to begin in Queens on Monday.

“Once I do all of that, I’ll be able to start working and become independent,” said Mr. Ampies, who is 30.

The long lines prompted East Village residents and businesses to offer help. Pep Kim, the owner of Café Chrystie on East 7th Street, gave away free cups of coffee to migrants. Assemblyman Harvey Epstein, a Democrat whose district office sits across from St. Brigid, helped give out hot meals, as well as donated winter jackets.

“These are human beings, whether they’ve been here two days, two months or 20 years,” Mr. Epstein said. “We need to manage the shelter problem because people need a place to stay, especially during this time of year.”

The problems that single adults are encountering now have raised concerns about how the city will deal with the first wave of migrant families that will be pushed out of shelters in a few weeks.

Advocacy groups and educators have warned that uprooting families every two months could subject migrant children enrolled in public schools to longer commutes, if they are assigned to shelters that are far from their schools.

Many of the newest families have been sent to tent dormitories in Floyd Bennett Field, a decommissioned airfield in southeast Brooklyn. City officials have said they have turned up the heat and distributed warmer blankets there.

Some families who hail from colder, mountainous regions in Venezuela said they had no complaints and were grateful for the services they were receiving.

But others said they were struggling to get used to the cold, including a family from Peru who said on Thursday that they were abandoning the shelter after two weeks, in part because of the cold.

Josette Almeida, a 17-year-old from Angola, is also staying in one of the airfield tents with her father and two siblings. So far they have stayed because they have nowhere else to go.

“It is freezing there,” she said. “At night the temperature drops a lot, the wind moves the roof of the tent and I get scared that it’s going to fly away. The truth is it’s very difficult to sleep.”