President Trump said that Ms. Leavitt, who recently gave birth to her second child, would be leaving to spend time with her family.