I'll repeat the answer I gave in another thread, though IANAL etc. (but I am a resident alien).
Federal law prohibits possession of firearms by a foreign national who is in the United States on a non-immigrant visa. Foreign nationals who are engaging in acquiring, or have acquired, permanent resident status are considered part of "the people" as far as the feds are concerned.
After that, it depends on state law. At one extreme of the spectrum is New York, which forbids non-US citizens from possessing "any dangerous or deadly weapon," period. Washington state forbids non-US citizens from so much as touching a gun unless they acquire a state Alien Firearms License*; once you have such a license, though, you're not subject to any restrictions that US citizens aren't. And some states, including Oregon and Virginia (as far as I can make out) place no special restrictions on resident aliens at all (in addition to the federal regulations, that is).
* - The Alien Firearms License is, frankly, rather pointless. To get one, you have to get a letter from the consulate of your country of origin stating that you have no criminal record in that country. But if you had a criminal record back in the old country, you'd still be there, because that would have disqualified you from immigrating to the US. You could still come to the US on a non-immigrant visa, of course, but as stated previously, federal law prohibits non-immigrant foreign nationals from possessing firearms already.