The captain's quarters will vary by ship but typically there'll be a separate bedroom and office space, so that the captain is able to switch off for a few hours of sleep without being in 'work mode'. However, they will be on call, so if there's an urgent situation they'll be summoned to the bridge to handle it.