Recreational marijuana -- the kind you smoke without a doctor's note -- wasn't legal anywhere in the United States five years ago.

Since then, voters in eight states and Washington, D.C., have given it the green light.

Sales of legal pot grew to $6.6 billion in 2016, according to New Frontier Data, a research company that analyzes the marijuana industry. That includes $4.7 billion for medical marijuana and $1.9 billion for recreational. The industry as a whole is projected to exceed $24 billion by 2025.

But there are rules for where you can buy pot and who can smoke it.

Related video: Will recreational weed soon be legal nationwide?

Here's what you need to know:

1. Anyone 21 or older can buy recreational marijuana in Colorado, Washington, Oregon and Alaska. Pot shops for recreational marijuana have been open for business in Colorado and Washington since 2014, in Oregon since 2015 and in Alaska since 2016.

2. You can possess pot and get high legally in eight states and Washington, D.C., as long as you're at least 21. Recreational marijuana was legalized last year in California, Maine, Massachusetts and Nevada. It was legalized in Washington, D.C., in 2015. But recreational dispensaries haven't been established in those places yet, and state and local authorities are still working out rules for taxation and zoning. If you want to grow your own, check local laws first, because they vary from state to state.

Vermont almost became the first state to legalize recreational marijuana through legislative means, but the governor vetoed the bill on May 24.

Related: These companies are racing to develop a Breathalyzer for pot

3. Medical marijuana is legal in 29 states. According to the Marijuana Policy Project, a pro-legalization group, medical marijuana is legal in 29 states and Washington, D.C., Puerto Rico and Guam. West Virginia became the 29th in April, the day before 4/20, when the governor signed medical marijuana into law. In 18 other states, medical marijuana laws are so restrictive that the MPP considers them "ineffective or flawed."

4. You can still be fired for smoking marijuana. Even if you show up for work as sober as a judge, you can be fired for flunking a drug test in most states. This has happened to some medical patients.

Related: Pot businesses worry about Trump, but expect to prevail

5. The government owns and operates a pot store. The city of North Bonneville, Washington, opened the Cannabis Corner in 2015. It's the first municipally owned pot shop. Profits go to special city projects, like upgrading the local playground.

6. There's a black market for pot, even where it's legal. That's not just because old habits die hard. Illegal pot is cheaper because it's tax-free, while legal recreational pot is taxed heavily. There's a 28% tax in Colorado and a 37% tax In Washington. In Oregon, the tax ranges between 17% and 20%, depending on the city and county. Growers, processors, retailers and buyers all pay taxes. Medical marijuana tends to be cheaper than recreational because it is taxed at a lower rate.

Related: Weed is legal in Nevada, but you won't find it on the Strip

7. Banking is a buzzkill for pot shops. Pot remains illegal in the eyes of the federal government, which classifies it the same as heroin. Banks are regulated by the feds, which means that most banks won't go near dispensaries, forcing many of them to deal in cash. In 2014, the Justice Department issued guidelines for banks on how to legally provide financial services to state-licensed marijuana businesses. But many banks remain wary of weed.

8. You can't take marijuana across state lines. Even when two legal states share a border, as Washington and Oregon do, carrying weed across state lines runs afoul of federal law. Don't bring it on a plane, and don't mail it.

9. You can't smoke and drive. Driving while stoned is illegal and dangerous, just like drunken driving. But there's no Breathalyzer for weed, a conundrum for cops. That could change, because two companies - Hound Labs and Cannabix Technologies - are testing marijuana Breathalyzers.

10. You can't smoke weed in public anywhere. Sorry, but those 420 pot parties in city parks are illegal, even in states where cannabis is legal.

--CNNMoney's Katie Lobosco contributed to this report.