Trump made his comments about a measure called the Johnson Amendment during remarks at the annual National Prayer Breakfast.
"I will get rid of and totally destroy the Johnson Amendment and allow our representatives of faith to speak freely and without fear of retribution. I will do that, remember," Trump told an audience including politicians, religious leaders and guests such as Jordan's King Abdullah.
The Johnson Amendment prohibits tax-exempt organisations such as churches, charities and educational institutions from directly or indirectly participating in any political campaign in favor or against a political candidate.
It is named after Democratic former President Lyndon Johnson and is an important statutory barrier between politics and religion.
Trump previously spoke out against the amendment during the campaign and won the support of evangelical Christian leaders including Liberty University President Jerry Falwell Jr.
A change in the law would require action in the Republican-led U.S. Congress. After Trump's remarks, Republican House of Representatives Speaker Paul Ryan told reporters he has "always supported" eliminating the Johnson Amendment.
Critics including the group Americans United for Separation of Church and State expressed alarm.
"President Donald Trump and his allies in the religious right seek to turn America's houses of worship into miniature political action committees," said the group's executive director, Barry Lynn.
"It would also lead some houses of worship to focus on supporting candidates in exchange for financial and other aid. That would be a disaster for both churches and politics in America," Lynn said.
Scrapping the Johnson Amendment has been a goal of Christian conservatives, who contend it violates free speech and religious freedom rights. The U.S. Constitution's First Amendment guarantees freedom of religion and bars the government from establishing an official religion.
Related reading
Trump call to Turnbull was harmful: McCain
'Pray for Arnold'
During his remarks at an event that typically is a solemn affair, Trump also said virtually every other nation was taking advantage of the United States and derided actor and former politician Arnold Schwarzenegger over TV viewership ratings.
He said Schwarzenegger, the Republican former governor of California, had disastrous ratings for the NBC reality TV program "Celebrity Apprentice," which Trump previously starred in.
"They hired a big, big movie star, Arnold Schwarzenegger, to take my place. And we know how that turned out," Trump said.
"It's been a total disaster. ... And I want to just pray for Arnold if we can, for those ratings, OK?"
Schwarzenegger, who endorsed Ohio Governor John Kasich over Trump for the Republican presidential nomination, shot back, alluding to the controversies of Trump's first two weeks in office.
"Hey Donald, I have a great idea," Schwarzenegger said in a video. "Why don't we switch jobs? You take over TV, because you're such an expert in ratings, and I take over your job. And then people can finally sleep comfortably again."
Related reading
'Why don't we switch jobs,' Arnold tells Donald
White House spokesman Sean Spicer later called Trump's remarks "light-hearted" and part of an "absolutely beautiful" speech.
A Trump executive order a week ago put a 120-day halt on the U.S. refugee program, barred Syrian refugees indefinitely and imposed a 90-day suspension on people from seven predominantly Muslim countries: Iran, Iraq, Libya, Somalia, Sudan, Syria and Yemen.
Trump defended his directive on Thursday as crucial to ensuring religious freedom and tolerance in America, and said he wanted to prevent a "beachhead of intolerance" from spreading in the United States. He also called terrorism a fundamental threat to religious freedom.
"The world is in trouble, but we're going to straighten it out. OK? That's what I do. I fix things," Trump said.
"When you hear about the tough phone calls I'm having, don't worry about it," Trump added, apparently referring to telephone conversations including one with Australian Prime Minister Malcolm Turnbull.
"It's time we're going to be a little tough folks. We're taking advantage of by every nation in the world virtually. It's not going to happen anymore," Trump said.