The law also requires foreign internet companies to keep their local servers inside Vietnam.
It has been criticised by internet companies and human rights groups, as well as the US government.
Vietnam is a one-party communist state and the authorities maintain a tight grip on the media.
Dozens of activists, including bloggers, have been convicted for anti-state activity in the country this year. The new law specifies that social networking sites such as Twitter and Facebook should only be used "to provide and exchange personal information".
It also prohibits the online publication of material that "opposes" the Vietnamese government or "harms national security".
Last month the US embassy in Hanoi said it was "deeply concerned by the decree's provisions", arguing that "fundamental freedoms apply online just as they do offline".
Reporters Without Borders, a Paris-based group that campaigns for press freedom worldwide, has said the decree will leave Vietnamese people "permanently deprived of the independent and outspoken information that normally circulates in blogs and forums".
The Asia Internet Coalition, an industry group that represents companies including Google and Facebook, said the move would "stifle innovation and discourage businesses from operating in Vietnam".