Guns are common in parts of the US, and you may see them in stores and at shooting ranges. Federal law has strict rules for non-citizens, and states add more.
If you are in the US on a nonimmigrant visa (for example F-1, J-1, H-1B, H-4, L-1, B-2), federal law generally forbids you to own, possess, buy or receive any gun or ammunition. This includes holding a friend's gun, and in many cases going to a shooting range.
There are limited exceptions, for example:
A valid hunting license or permit from a US state.
Certain foreign officials and law enforcement on official duty.
Some other narrow cases listed by the ATF.
Even with an exception, state and local laws also apply.
People without lawful status
Federal law forbids people who are in the US unlawfully from possessing guns or ammunition. There are no exceptions.
Green card holders are generally treated like citizens under federal gun law. They can buy guns if they are not otherwise prohibited, and must follow state and local laws. People with certain convictions, including domestic violence convictions and protective orders, cannot have guns.
Buying a gun from a licensed dealer requires ATF Form 4473 and a background check. The form asks about immigration status. Lying on it is a federal crime.
If someone in your home has a gun, it should be locked and unloaded, with ammunition stored separately, especially if children live or visit there.
It is fine to ask other parents before a playdate: "Is there a gun in the house? Is it locked?"
Going to a shooting range "just to try it" on a student visa.
Keeping a roommate's gun in your room.
Carrying a gun across state lines without checking each state's law.