Like all new laws in the district, the bill now goes to Congress for review. House Speaker John Boehner has said Congress will "look at'' the bill.
Seventeen states have some form of decriminalization, and Congress rarely acts to invalidate district laws.
Gray signed the bill on Monday, a day before Democratic primary voters will decide whether he should receive a second term. The bill's lead sponsor is one of the mayor's opponents, D.C. Councilmember Tommy Wells.
Wells describes the law as "a victory for the district and a victory for justice,'' citing a study that found black residents were eight times more likely than whites to be arrested for pot possession.