The law will mean that from 2016, all Internet companies will have to move Russian data onto servers based in Russia or face being blocked from the web. That would likely affect U.S.-based social networks such as Facebook, analysts say.
Coming after new rules requiring blogs attracting more than 3,000 daily visits to register with a communications watchdog and a regulation allowing websites to be shut without a court order, critics say the law is part of a wave of censorship.
"The aim of this law is to create ... [another] quasi-legal pretext to close Facebook, Twitter, YouTube and all other services," Internet expert and blogger Anton Nossik said Friday.
"The ultimate goal is to shut mouths, enforce censorship in the country and shape a situation where Internet business would not be able to exist and function properly."
Putin, an ex-KGB officer who has called the Internet a "CIA project," denied he was restricting web freedoms, saying his main concern was protecting children from indecent content.
Speaking to a business forum in May, he denied there were plans to ban Facebook and Twitter.
The Kremlin adopted a law earlier this year giving authorities power to block websites deemed either extremist or a threat to public order without a court ruling.
Among the websites blocked were those of Kremlin critics Alexei Navalny and Garry Kasparov because they "contained calls for illegal activity".
Last month a senior Twitter executive met the head of Russia's communications watchdog Roskomnadzor, after it was asked to block a dozen unspecified accounts. A Twitter spokesman later said it had not agreed to block any accounts in Russia.
Putin has adopted an increasingly conservative stance since he faced massive protests against his return to the Kremlin in 2012. Protesters used social networks to share critical views of the authorities and coordinate their moves.