Official publication of the law came two days after a bomb attack on a supermarket in Saint Petersburg, Russia's second city, injured 14 people.
The new law, which parliament voted through on December 14 and the upper chamber approved on December 26, immediately raises the maximum sentence for terrorist recruitment and finance to life from 10 years.
Russia's military intervened in Syria in September 2015 to shore up the regime of President Bashar al-Assad and combat jihadists, making Russia a major target for such groups.
Putin called Wednesday's blast in his home city of Saint Petersburg an "act of terror" and yesterday warned armed criminals they faced being "liquidated on the spot."
Russia's FSB security service said two weeks ago it had broken up an IS cell planning a December 16 terror attack at an Orthodox cathedral in Saint Petersburg, a key tourist attraction.