ATHENS—Greece is steadily shifting from being the main gateway for migrants into Europe to becoming the continent’s bottleneck, as new arrivals run up against tightened borders to the north.

Already struggling with its long debt crisis and economic depression, Greece risks finding itself unable to cope with the tens of thousands of migrants at risk of being marooned here this winter. Some are staying in temporary government shelters, others are sleeping rough.

“There...