As a nonimmigrant visa holder, you are obviously not a permanent resident of the United States. Nevertheless, you might be what’s called a "tax resident" or "resident alien."
It depends on how much time you spend in the United States each year. Being a tax resident comes with tax-reporting obligations, and in some cases payment obligations as well. (Green card holders are all tax residents.)
If you have been in the U.S. for a weighted total of 183 days during the previous three years, you are a tax resident—unless, that is, you spent fewer than 30 days in the U.S. within the current tax year. This is called the "substantial presence" test.
Here is how you determine the weighted total number of days: Each day in the current tax year counts as one, regular day, each day in the previous year counts as only one third of a day, and each day in the second previous year counts as only one sixth of a day.
This latter rule does not apply to students, professional athletes, certain foreign government diplomats or employees of international organizations, and certain teachers or trainees holding a J or Q exchange visitor visa.
You might also avoid being viewed as a tax resident or resident alien if you spent fewer than 183 days of the current tax year in the U.S., you maintain a tax home in another country, and you have a closer connection to that country than to the United States.
There are other exceptions to these rules. A tax treaty between the U.S. and your home country could also alter them. If you have any questions about your situation, consult with a tax accountant or lawyer.
A tax resident is obligated to file a U.S. tax return and potentially pay tax to the U.S. government. If you become a tax resident, your entire worldwide income must be reported to the U.S. government.
It doesn’t matter if a portion or all of that income was earned from investments or business activities carried on outside the United States. The income still must be reported.
Having to report your worldwide income does not necessarily mean that the U.S. government will actually tax all of it, however. Various international treaties control whether or not you must pay U.S. taxes on income earned in other countries. If, however, you stay in the U.S. long enough to become a tax resident, you will have to at least report all income you have earned worldwide—a paperwork burden, if nothing else.
What this means in practice is that you will need to file U.S. tax return Form 1040 each year by April 15. The good news is, if you’ve been working for a U.S. employer that’s been withholding taxes from your paycheck, you might be due a refund.
Failure to follow U.S. tax laws can be treated as a criminal offense and can make it more difficult for you to stay in the U.S. or ultimately obtain a green card here (permanent residency), if that is your eventual goal. To find out exactly how to comply with U.S. tax laws, consult a tax professional or lawyer.