The justices have agreed to hear the social media app’s challenge to a law that could ban it in the U.S. starting next month.