The high court entered the debate over gay marriage, announcing it would accept cases from New York and California that test the rights of same-sex couples.