After months of clashes with the White House, the historian and leader of the institution is retiring later this year.