Among the countries that abstained were Argentina, Australia, Canada, Croatia, the Czech Republic, Hungary, Latvia, Mexico, the Philippines, Poland, Romania and Rwanda.
Speaking ahead of the emergency session, US Ambassador Nikki Haley warned the General Assembly that the United States "will remember this day."
"America will put our embassy in Jerusalem," Haley said in defense of the US move, which broke with international consensus and unleashed protests across the Muslim world.
"No vote in the United Nations will make any difference on that," Haley said. "But this vote will make a difference on how Americans look at the UN and on how we look at countries who disrespect us in the UN."
"When we make generous contributions to the UN we also have a legitimate expectation that our goodwill is recognized and respected," she said.
The resolution reaffirms that the status of Jerusalem must be resolved through negotiations, and that any decision reached outside of that framework must be rescinded.
Without explicitly referencing the US move, it "affirms that any decisions and actions which purport to have altered the character, status or demographic composition of the Holy City of Jerusalem have no legal effect, are null and void and must be rescinded in compliance with relevant resolutions of the Security Council."
The motion was sent to the General Assembly after it was vetoed by the United States at the Security Council on Monday, although all other 14 council members voted in favor.
While resolutions by the General Assembly are non-binding, a strong vote in support carries political weight.
Ahead of the vote, Israel's Prime Minister Benjamin Netanyahu blasted the UN as a "house of lies," saying Israel "rejects outright this vote, even before it passes."
"No General Assembly resolution will ever drive us from Jerusalem," vowed Danny Danon, Israel's envoy to the United Nations.
Palestinian foreign minister Riad al-Malki called the vote an "unprecedented test" for the UN, and referenced the US warning that it was "taking names."
"History records names, it remembers names -- the names of those who stand by what is right and the names of those who speak falsehood," al-Malki said. "Today we are seekers of rights and peace."
Trump's decision on December 6 to recognize Jerusalem as Israel's capital prompted a flurry of appeals to the United Nations.
The status of the Holy City is one of the thorniest issues in the Israeli-Palestinian conflict, with both sides claiming it as their capital.
Trump warned that Washington would closely watch how nations voted, suggesting, like Haley, there could be financial reprisals for those that back the motion put forward by Yemen and Turkey on behalf of Arab and Muslim countries.
"They take hundreds of millions of dollars and even billions of dollars and then they vote against us," Trump said at the White House.
"Well, we're watching those votes. Let them vote against us. We'll save a lot. We don't care."
'House of lies'
The resolution mirrored the text that was vetoed at the Security Council on Monday, and although it does not mention Trump's decision, it expresses "deep regret at recent decisions" concerning the city's status.
No country has veto powers in the General Assembly, unlike in the 15-member Security Council where the United States, along with Britain, China, France and Russia, can block any resolution.
Among the 14 countries voting in favor on Monday were Britain, France, Italy and Japan and they did so again on Thursday.
Ukraine, which supported the draft resolution in the Security Council, was among 21 countries that did not turn up for Thursday's vote.
Israel seized the largely-Arab eastern sector of Jerusalem during the 1967 Six-Day War and later annexed it, claiming both sides of the city as its "eternal and undivided capital."
But the Palestinians want the eastern sector as the capital of their future state and fiercely oppose any Israeli attempt to extend sovereignty there.
Several UN resolutions call on Israel to withdraw from territory seized in 1967 and the draft resolution contains the same language as past motions adopted by the assembly.