Authorities say the new Computer-Related Crimes Act will help crack down on Internet pornography. However, media rights activists say the law will allow the government to invade people's privacy.
Penalties under the new law include up to 20 years in prison for actions found to be a threat to national security.
"This is to prevent computers being used for sending pornographic material or slanderous messages," Information and Communications Technology Ministry spokesman Vissanu Meeyoo said.
Supinya Klangnarong, a representative of the watchdog group Freedom Against Censorship Thailand, said the new law allows authorities to snoop through private files on people's computers.
"The new law is a threat and violates people's privacy," Supinya said. "It's not preventive as they said; it is a controlling measure."
Since a military coup last year, some 45,000 websites have been blocked by the government and media rights groups say the number is rising. Most of the blocked sites have adult material, but the government also has targeted sites critical of the king or supportive of ousted premier Thaksin Shinawatra.
YouTube was blocked in April after clips were posted showing digitally altered images of King Bhumibol Adulyadej. YouTube remains inaccessible in Thailand.
New York-based Human Rights Watch said in May that Thailand was stifling free political debate in the kingdom by shutting down political websites and moving to silence online critics.