In general, while economic conditions have not been the only thing that has affected our attitudes towards immigrants and our policies toward them, we have generally been less welcoming to immigrants at times when our economy has been doing badly. Again, however, there have been many other factors that have played into this.
When economic times are good, immigrants seem to be less of a threat. They do not seem as if they are going to “take our jobs” because almost everyone has a job already. When the economy is going poorly, worries about immigrants grow. We can see this in the way in which concerns about illegal immigration have become stronger since the financial crisis of 2008.
This is not to say, however, that economic factors are the only thing that matter. For example, we passed very restrictive immigration laws in the 1920s, which is generally seen as a time of great prosperity. People also worry about things like the total number of immigrants and the places from which they come.
Thus, we can see that economic factors are important in affecting our attitudes towards immigration, but they are not the only thing that matters.