The US Supreme Court, in a decision with potentially far-reaching ramifications, agreed on Monday to hear two cases challenging the legal immunity of internet companies from liability for content posted by their users.