It would be difficult to say there is an official Church teaching on immigration. The issue varies from country to country and from era to era. There are also different kinds of immigrants, there are displaced refugees fleeing war or famine and there are people seeking various increased levels of social/economic conditions.
The Catechism sums up the basic principles the Church asks us to apply when making prudent judgments and decisions about immigration:
2241 The more prosperous nations are obliged, to the extent they are able, to welcome the foreigner in search of the security and the means of livelihood which he cannot find in his country of origin. Public authorities should see to it that the natural right is respected that places a guest under the protection of those who receive him.
Political authorities, for the sake of the common good for which they are responsible, may make the exercise of the right to immigrate subject to various juridical conditions, especially with regard to the immigrants’ duties toward their country of adoption. Immigrants are obliged to respect with gratitude the material and spiritual heritage of the country that receives them, to obey its laws and to assist in carrying civic burdens.
Scriptural tradition has encouraged the people of God to be welcoming:
Deuteronomy 10: 19 You shall also love the stranger, for you were strangers in the land of Egypt.
Leviticus 19:34 The alien who resides with you shall be to you as the citizen among you; you shall love the alien as yourself, for you were aliens in the land of Egypt: I am the Lord your God.
Matthew 25:40 Truly I say to you, as you did it to one of the least of my brethren you did it to me.
Hebrews 13: 1 Let mutual love continue. Do not neglect to show hospitality to strangers for by doing that some have entertained angels without knowing it.
Matthew 25: 35 I was hungry and you gave me food, I was thirsty and you gave me drink, I was a stranger and you welcomed me.
Romans 12:13 Contribute to the needs of the saints; extend hospitality to strangers.
The Church clearly recognizes the right of the State to make prudential judgments about immigration laws. The Church also challenges the State to be as generous and accommodating as reasonably possible. The Church encourages us to reflect upon whether we are truly welcoming of our brothers and sisters and respecting their human dignity through our laws and policies. Reasonable -people will disagree on the particulars but we must begin with common principles.
For further reading:
USCCB’s Position on Immigration Reform
Vatican says Catholics have obligation to aid, defend refugees
Pope Francis’ message for World Day of Migrants and Refugees