Apple Inc.’s head of hardware design, Evans Hankey, is leaving the iPhone maker three years after taking the job, creating a significant hole at the top of a company famous for its slick-looking products, according to people with knowledge of the matter.