The Supreme Court agreed Monday to consider a major case testing the president’s power to fire executive branch officials.