The Gun Control Act (GCA), codified at 18 U.S.C. § 922(g), makes it unlawful for certain categories of persons to ship, transport, receive, or possess firearms or ammunition, to include any person:
…
who has been adjudicated as a mental defective or has been committed to any mental institution;
Not legally.
https://www.atf.gov/firearms/identify-prohibited-persons