There's a good chance that you live in a state that has legalized the medical use of marijuana, because over half the U.S. states have done so. U.S. citizenship is not even a requirement to obtain a medical marijuana card—although some states do require people to register with a government agency in order to take advantage of the law, including showing a state-issued identification card to prove they live there.
If you are not in the United States legally, you could have difficulty obtaining such identification. If you are a lawful permanent resident of the U.S. (a "green card" holder) and you don't yet have identification like a driver's license or state ID card, however, you can apply for one by showing your green card.
If you are a lawful permanent resident considering applying for a medical marijuana card, you should know the possible consequences if federal authorities find out. As discussed below, you:
This article discusses the consequences of marijuana use for permanent residents. If you are not a permanent resident, you still risk (deportation as discussed below), and you should also consider the effect on your future visa eligibility. For more on marijuana use and inadmissibility, see Will Legal Use of Marijuana Make Applicant for Immigration Benefits Inadmissible?
Just because your state's has legalized medical marijuana does not mean there is no risk to your lawful permanent resident status if you do so. This is because your immigration status is a federal matter, governed by federal law, which makes any marijuana use illegal in the eyes of the federal government.
So, even though your state might not convict you for using marijuana for medical purposes, the federal government can, and sometimes does.
Green card holders convicted of a violation of a federal law relating to marijuana (other than a single offense involving possession for their own use of 30 grams or less) are deportable. You're also deportable if you are a "drug abuser or addict." It's possible that the U.S. government will allege that your medical use of marijuana constitutes abuse or addiction.
Also, conviction of certain crimes involving "moral turpitude" can get you deported. That's a fuzzy term under U.S. immigration law, and you can't be sure what a court will say. However, possession of marijuana for personal use is likely not a crime involving moral turpitude. Growing marijuana for a medical purpose likely wouldn't be, either. For more information, see Crimes That Will Make an Immigrant Deportable.
Even if U.S. immigration authorities don't take immediate steps to deport you, they will raise questions about drug use if and when you apply for U.S. citizenship, at which time USCIS could deny your application or take steps to deport you.
If you're a green card holder who wants to travel outside the U.S., your medical use of marijuana could cause you problems getting back in and staying in the United States. This is because the U.S. Customs and Border Protection (CBP) officer at the border could treat you as an "arriving alien" who must be "admissible" in order to enter the United States.
As a green card holder, you're not always considered an arriving alien when returning after foreign travel. However, you could be considered an "inadmissible arriving alien" if you have been convicted of a federal crime relating to marijuana—or even if you admit to past marijuana use, regardless of whether it was in the state where you used it. (Carrying a medical marijuana card in your wallet is a sure tipoff.)
You also have to be concerned with anything you've done that would give the U.S. government reason to believe you're a marijuana "trafficker," or dealer. This might include admitting that you work for a legal dispensary or grower.
If the U.S. government determines that you are an inadmissible arriving alien, you will most likely be let back into the U.S. temporarily, and the U.S. government will begin deportation (removal) proceedings against you. You might be eligible for a "waiver" of your inadmissibility if your crime is a single offense of simple possession of 30 grams or less of marijuana. If that does not apply to your situation, a good lawyer might be able to find other grounds upon which to apply for a waiver, depending on your circumstances. Ultimately, though, the best way to avoid deportation for marijuana is to avoid giving the U.S, government any reason to believe you have violated federal drug laws.
Talk to an experienced attorney for a full analysis of your situation, particularly if you plan to travel outside the United States. And if you are arrested and placed into immigration court proceedings, getting an attorney's help will be crucial.