The decision by the Homeland Security Department’ to end protections for migrants from those countries goes into effect in about two months.