The legislation makes New York the first large city or state in the country to prohibit sales to young adults.
During a bill-signing ceremony Tuesday, Bloomberg said the law will help prevent young people from experimenting with tobacco at the age when they are most likely to become addicted.
City health officials say 80 percent of smokers start before age 21.
Tobacco companies and some retailers had opposed the age increase. They say it will simply drive teenagers to the city's thriving black market.