The 60-year-old Gretzky says he will not be able to "dedicate the time nor effort needed to support this world-class organization."
The move comes one day after the Oilers were eliminated from the playoffs when the Winnipeg Jets completed a sweep of Edmonton in the first round. The Oilers featured the league's top two regular-season scorers in Connor McDavid and Leon Draisaitl.
"The Oilers, their fans and the city of Edmonton have meant the world to me for four decades — and that will never end," Gretzky said.
The NHL's all-time leading scorer and a four-time Stanley Cup winner as a player with Edmonton, Gretzky returned to a front-office role with the Oilers in 2016.