I use cannabis as part of my Christian faith. I believe early Jews and Christians used cannabis in various forms. I feel it brings me closer to Christ. I have looked into what protection this might afford me in court (if ever arrested), and the answer is, sadly, very little.
Federal Courts have, in some instances, allowed illegal drug use for religious purposes. One case involved Rastafari followers using cannabis. Another involved American Indians using Peyote.
However, State courts do not have to follow Federal precedent. In a leading case (City of Boerne v. Flores 521 U.S. 507, 117 S.Ct. 2157 (1997)), the Supreme Court says that States do not have to follow the RFRA (Religious Freedoms Restoration Act) which Federal Courts have used to allow illegal drug use for religious purposes. Essentially, States get to choose what "freedom of religion" means apart from how the Federal authorities define it as far as illegal drug use is concerned.
North Carolina, my State, has not been friendly. In one NC case, State v. Carignan 178 N.C.App. 562, 631 S.E.2d 892 (Table) N.C.App.,2006. Jul 18, 2006, the state supreme court rejected the defendants defense for his possession of marijuana that he was a religious user. Defendant claimed at trial that for several months prior to his arrest, he had been involved with the "Hawaiian Cannabis Ministry," which, according to defendant, "regards the actual consumption of cannabis as prayer [and] a form of worship." Essentially, the NC supreme court decided that North Carolina was under no obligation to follow Federal precedent under the RFRA, and the NC constitution allowed the police to enforce all drug laws regardless of religion.
I don't have time to look into every State's precedent, and some states may not have approached the issue yet. But generally most States would reject any sort of religious use defense. And most of the time you would end up in State Court, not Federal Court. And even in Federal Court, you would have to do a lot to prove you use religiously... the assumption would be that you use recreationally and you would have to have a lot of documentation and evidence that cannabis is part of your religion.
As far as legal protection, living in a State that has medical laws allowing cannabis and getting a "card" or "license" in one of those states is a much safer way to use legally then trying any sort of religious defense in court.