SAN FRANCISCO — Gay and lesbian couples in San Francisco rejoiced on Thursday over a State Supreme Court decision affirming their right to marry even as political leaders on both sides of the issue girded for an extended fight over the ruling in the courts and at the ballot box.