Realistically? As many times as you want.
Of the guys that have been banned and never reinstated, most were banned for point shaving and gambling, and the last two guys to get totally banned from the league were banned for drinking.
I mean, Chris Anderson got caught doing meth, and they let him back in eventually. I don't think anyone's losing any sleep over JR Smith smoking up.
Don't know if it's changed in the new CBA, but under the last one, you could only be kicked out of the league after a fourth positive test for PEDs or one positive for "drugs of abuse;"
The drugs on that list are amphetamine and its analogs, which include methamphetamine; cocaine; LSD; opiates, including heroin, codeine and morphine; and PCP.
http://sports.espn.go.com/nba/news/story?id=3275986