In a set of cases grouped under Obergefell v. Hodges, the high court ruled, 5-4, that states have to license same-sex marriages, as well as recognize same-sex marriages from other states. All four dissenting justices wrote dissents.
Before the ruling, 13 states had same-sex marriage bans in place. The majority of the 37 states that recognized gay marriage did so as a result of federal court action. Those states' statuses had been in question with this ruling. The court could have instead upheld bans, which might have meant some of those states could have gone back to prohibiting gay marriage.
Here's how the map of same-sex marriage laws will now change, as a result of this decision.