Which of the following sentences is punctuated correctly?

A. Mark and Ryan who had been sitting there for an hour finally decided to leave.
B. Mark and Ryan, who had been sitting there for an hour, finally decided to leave.
C. Mark and Ryan, who had been sitting there for an hour finally decided to leave.