Immigration law in the United States is governed by federal law. Until the U.S. Supreme Court's June, 2013 decision in U.S. v. Windsor, federal law did not recognize same-sex marriages as the basis for immigration or any other benefits. If you are a U.S. citizen or lawful permanent resident (LPR or "green card holder") and you submit an immigration petition (Form I-130) on behalf of your same-sex partner, U.S. Citizenship and Immigration Services (USCIS) is now legally obligated to process the petition (though, as with any couple, approval is not guaranteed).
The federal Defense of Marriage Act (DOMA) -- the one that the Supreme Court struck down key portions of in 2013 -- defined marriage as solely consisting of a union between a man and a woman. This was the law that USCIS had to consider when determining what a marriage was. Although numerous U.S. states as well as other countries recognized same-sex marriages or civil unions, immigration law is federal, so the legality of their marriage did not help anyone gain rights to a visa or green card.
If you are part of a same-sex couple, you should be able to apply for immigration benefits, in the same manner as heterosexual couples do. If you are not yet married, you can either get married overseas, do so immediately in the U.S. (if the non-citizen is already here and you comply with the legal requirements in a state authorizing same-sex marriage) or do so in the U.S. after bringing the non-citizen here on a fiance (K-1) visa.
Two key steps, for immigration purposes, include that you obtain a government-issued certificate showing that you are legally married, and that you prepare to prove to the U.S. immigration authorities that you are in a real relationship and are establishing a shared life (preferably by coming up with documents evidencing your shared living arrangements, joint financial accounts, and so forth). Take some wedding, pictures, too!
For more information on fiance and marriage visas, see the articles in the "Family-Based Immigration" section of this website.
It may take some time for USCIS to get accustomed to this new law. If you are part of an international same-sex couple, talk to an experienced U.S. immigration attorney. The attorney can advise you on any recent developments and your immigration options, and help identify any potential complications in your case.