There are two classifications of people that the U.S. uses with regard to taxes: tax residents and non-tax residents. You may be wondering how immigration and taxes apply to you.
There are many situations in which you may be required to pay taxes even if you are not a U.S. citizen. Whether or not you have to file and pay taxes depends on whether the government has classified you as a tax resident or not. For example, all permanent residents, or holders of green cards, are considered to be tax residents. However, not all non-immigrant visa holders are tax residents. Even if you are not a tax resident, it may be a good idea to file an income tax return if you have been working for an employer that withholds taxes from your wages; it might result in a tax refund.
Tax residents must report their entire income to the IRS and pay taxes. It doesn't matter whether the money was earned within the country or internationally, all income must be reported to the IRS. Reporting all of your income to the IRS doesn't mean that all of your income will be taxed, those decisions are governed by international tax treaties.