Actually, it depends on the state.
Federal law says that any alien "legally in the US" can own a firearm.
I bought my first gun while on an H1-B. However, when you are a non-immigrant alien (don't have a green card), you need to jump through a lot more hoops (hunting license, continuous presence in the US for 90 days). Non-immigrant aliens MUST buy their firearms from a licensed dealer, so that the background check can be done (it also includes an immigration check).
However, many states require that you have a green card or are a US citizen. There is at least one state that only allowed citizens to buy a firearm, but I can't remember which one right now, somewhere in the mid-west. Some only put that restriction on handguns, allowing aliens to own rifles and shotguns.
Michigan used to require citizenship (handguns), but that was declared unconstitutional under the "equal protection clause".
Some states require that non-citizens file a "intent to become a US citizen" form before being allowed to buy a firearm.
You might be able to find some info here, but I think it's kind of outdated:
US Gun Laws for Non-citizens
This site is more up to date, but it deals with concealed carry permits. However, if state law says a permanent resident can get a CCW permit, then you know they can also own handguns/rifles/shotguns.
Handgun Laws by State
mdh