Outside the court, protesters for and against rallied with signs, music, and preaching - reflecting the deep and sometimes bitter national divide.
Inside, the proceedings were interrupted by someone shouting that the justices would "burn in hell" if they were to back gay marriage.
Currently, 36 of the 50 US states allow same-sex couples to marry.
Based on their questions, the nine justices appeared divided on the issue.
The court is also determining whether to require states to recognise marriages performed in other states.
Justice Anthony Kennedy, whose vote could prove pivotal on the issue, said marriage has been understood as being between one man and one woman for "millennia-plus time".
He also questioned whether scholars and the public had had enough time to debate the issue.