The poll also found a near-even split over whether local officials with religious objections should be required to issue marriage licenses to same-sex couples, with 47 per cent saying that should be the case and 49 per cent say they should be exempt.
Overall, if there's a conflict, a majority of those questioned think religious liberties should win out over gay rights, according to the poll. While 39 per cent said it's more important for the government to protect gay rights, 56 per cent said protection of religious liberties should take precedence.
The poll was conducted July 9 to July 13, less than three weeks after the Supreme Court ruled states cannot ban same-sex marriage.
According to the poll, 42 per cent support same-sex marriage and 40 per cent oppose it. The percentage saying they favour legal same-sex marriage in their state was down slightly from the 48 per cent who said so in an April poll. In January, 44 per cent were in favour.
Asked specifically about the Supreme Court ruling, 39 per cent said they approve and 41 per cent said they disapprove.
"What the Supreme Court did is jeopardize our religious freedoms," said Michael Boehm, 61, an industrial controls engineer from the Detroit area who describes himself as a conservative-leaning independent.
"You're going to see a conflict between civil law and people who want to live their lives according to their faiths," Boehm said.
Boehm was among 59 per cent of the poll respondents who said wedding-related businesses with religious objections should be allowed to refuse service to gay and lesbian couples. That compares with 52 per cent in April.
Also, 46 per cent said businesses more generally should be allowed to refuse service to same-sex couples, while 51 per cent said that should not be allowed.
Claudette Girouard, 69, a retiree from Chesterfield Township, Michigan, said she is a moderate independent voter who has gradually become supportive of letting same-sex couples marry.
"I don't see what the big hoopla is," she said, adding: "If they're happy, why not?"
Girouard said local officials should be required to perform same-sex marriages, but does not think that wedding-related businesses should be forced to serve same-sex couples.
"If the official doesn't like what he's being asked to do, then quit," she said. "But businesses are kind of independent, so if they have a strong belief against it, there are enough other businesses out there for someone to use."
The poll found pronounced differences in viewpoints depending on political affiliation.
For example, 65 per cent of Democrats, but only 22 per cent of Republicans favoured allowing same-sex couples to legally marry in their state. And 72 per cent of Republicans but just 31 per cent of Democrats said local officials with religious objections should be exempt from issuing marriage licenses.
By a 64-32 margin, most Democrats said it's more important to protect gay rights than religious liberties when the two are in conflict. Republicans said the opposite, by 82-17.
Clarence Wells, 60, a conservative from Rockwood, Tennessee, said he strongly disapproved of the Supreme Court's ruling. He anticipates friction as gay couples try to exercise their newfound rights and people with religious objections to same-sex marriage balk at accepting them.
"I don't believe it's going to go over smoothly," said Wells. "I think a lot of them will be shunned in church. ... I think there will businesses that are going to close, because some people are stubborn enough to not want to deal with it."
Andrew Chan, 41, a moderate independent from Seattle, said he has tried to remain neutral on same-sex marriage.
"For me, it's always been about tolerating," said Chan, who works for a non-profit organization. "I've got friends on both sides."
Chan said he was happy for gays and lesbians who have found someone they want to marry, and he expressed some wariness toward politicians who might try to roll back the Supreme Court ruling.
"That just creates more division," he said. "Are we looking to move the country forward or move it backward?"
The AP-GfK Poll of 1,004 adults was conducted online July 9 to July 13, using a sample drawn from GfK's probability-based KnowledgePanel, which is designed to be representative of the U.S. population. The margin of sampling error for all respondents is plus or minus 3.4 percentage points. Some questions were ask of half samples of respondents and have smaller margins of error. Respondents were first selected randomly using phone or mail survey methods, and later interviewed online. People selected for KnowledgePanel who didn't otherwise have access to the Internet were provided access at no cost to them.
Swanson reported from Washington.
Reach David Crary on Twitter at http://twitter.com/CraryAP and Emily Swanson at http://twitter.com/EL_Swan
AP-GfK Poll: http://www.ap-gfkpoll.com