Apple CEO Tim Cook is stepping back to be executive chairman, and SVP John Ternus is stepping up to replace him, the company says.