The president said Mr. Scharf, a deeply conservative lawyer and the current staff secretary, would replace David Warrington in early September.