The Marriage and Civil Partnership (Amendment) Act 2016 will also allow heterosexual couples to have civil partnerships instead of marriages if they so choose.
The Isle of Man is the first place in the British Isles to allow straight couples to enter into civil partnerships as an alternative to marriage.
However, Church of England buildings do not have to perform same-sex marriage ceremonies.
The bill was promoted by Chief Minister Allan Bell CBE MHK, on behalf of the Council of Ministers, he said it was a "historic moment" for the island.
Mr Bell went on: "Recognition of marriage for same-sex couples in Manx law is a truly historic moment, showing just how far the Island has travelled over the past 30 years.
"It sends out a clear message that the Isle of Man today is a modern, open and inclusive society where equal rights are respected.
"I believe that the values of fairness and tolerance reflected in this legislation are shared by the overwhelming majority of our population."
The law means same-sex couples have the option to either in a civil ceremony, in a register office or approved premises, or in religious premises.
Church of England institutions are exempt, subject to the agreement of the religious organisation in question.
Civil partnerships have been available to same-sex couples in the Isle of Man since 2011.