“Are you an unlawful user of, or addicted to, marijuana or any depressant, stimulant, narcotic drug, or any other controlled substance?”
So asks Question 11(e) on Firearms Transaction Record, U.S. Department of Justice, Bureau of Alcohol, Tobacco, Firearms, and Explosives (ATF), Form 4473. And as of January 16, 2017, that form came with the nice, new, emboldened warning:

The use or possession of marijuana remains unlawful under Federal law regardless of whether it has been legalized or decriminalized for medicinal or recreational purposes in the state where you reside.

So, if you live in a state that has decided to allow recreational use of marijuana, or in a state that recognizes medicinal cannabis, and are using or possessing, you are now ineligible to purchase a firearm from a federally licensed gun dealer.

What? Are you serious?

Yes. In 1968, U.S. Congress passed the Gun Control Act, giving the ATF wide latitude in the enforcement of federal gun laws. This was extensively revised in 1986 under the Firearm Owners’ Protection Act of 1986 (FOPA). In this amendment, which greatly enhanced 2nd amendment protections for many U.S. citizens, it did specify those individuals prohibited from firearm ownership. Included on this list were:

Anyone who is an unlawful user of or addicted to any controlled substances.

In the wake of the marijuana and cannabis state legalization effort, ATF, in a “Open Letter to All Federal Firearms Licensees,” informed the public that holders of state-issued medical marijuana cards were automatically “prohibited persons” under 18 U.S.C 922 (g)(3). Furthermore, “shipping, transporting, receiving or possessing firearms or ammunition” by a medical marijuana card holder is a violation.
And just last August, the U.S. Court of Appeals for the 9th Circuit ruled that banning gun sales to people who have medical marijuana cards is consistent with the Second Amendment because “empirical data and legislative determinations support a strong link between drug use and violence.” Specifically:

illegal drug users, including marijuana users, are likely as a consequence of that use to experience altered or impaired mental states that affect their judgment and that can lead to irrational or unpredictable behavior.

The appeals court also argued that cannabis consumers are “more likely to have negative interactions with law enforcement officers because they engage in criminal activity.” It added that “they frequently make their purchases through black market sources who themselves frequently resort to violence.”
The 9th Circuit Court case is Wilson v. Lynch, and can be found here.
In addition, on February 1 of this year, a U.S. District Court ruled that a state (Kansas) law attempting to shield its citizens from federal enforcement of laws pertaining to the 2nd amendment was unconstitutional. The Kansas Second Amendment Protection Act, which passed in 2013, says firearms, accessories and ammunition manufactured and kept within the borders of Kansas are exempt from federal gun control laws. The law was patterned on that passed in other states that included Alaska, Arizona, Idaho, Montana, South Dakota, Tennessee, Utah and Wyoming.
In striking the state law, the district judge noted that the U.S. Supreme Court upheld the National Firearms Act as a valid exercise of Congressional taxing power over eighty (80) years ago. As such, it supersedes a state law.
So what are the risks?
Under the upheld interpretation, a medicinal cannabis or recreational marijuana consumer who purchases a gun (whether or not the use or possession of the cannabis or marijuana is legal under state law) is guilty of a federal felony punishable by up to ten (10) years in prison. Furthermore, anyone who sells such an individual a gun, if the seller has reason to know the buyer is a cannabis or marijuana consumer, is likewise guilty of a similar federal felony.
And falsely denying marijuana use on Form 4473 can get you up to five (5) years in federal prison.

Any optimism?

In Oregon, sheriffs tried to deny concealed handgun permits from medical cannabis patients. The patients sued and were successful before the Oregon Supreme Court. The sheriffs appealed to the United States Supreme Court, but the court refused to hear the appeal in 2011, allowing patients’ rights to prevail in the Beaver State.
Since, the 9th Circuit Court came to a different result, it would appear the matter would now be ripe for the Supreme Court. A petition for writ of certiorari was filed on February 1, 2017 (see Wilson v. Session, Case No. 16-951) and a response is due March 3, 2017. However, the prospects do not look great, as such petitions are rarely granted and the conflict is within the same jurisdiction (i.e. Oregon is within the 9th Circuit) and the 9th Circuit opinion overrules the Oregon State Supreme Court on the interpretation of federal law. So, it would appear one would have to wait for another circuit of the U.S. Court of Appeals to come to a different result.
Furthermore, although NORML is backing the effort to protect 2nd amendment rights for legal cannabis or marijuana users, the National Rifle Association is radio silent. The NRA has not gone on the record with a position on either the 9th District Court of Appeals ruling or the revision to Form 4473.
And one could hope that ATF would modify its prior interpretation. Or, Congress could amend the act. However, given the tenor on marijuana from the incoming Attorney General, I would believe that such a possibility is remote.