The Brand MP, who has held his seat since 2007, said it was not an overnight decision.
“I came to the decision sometime ago,” he said.
“It was the realisation that in 1983, when Bob Hawke became Prime Minister, the average age of politicians was 41,” he said.
“I’m 57. What chance does the younger generation have at political opportunities?
“There is something in that to think about.”
Mr Gray cited bringing services that Rockingham needed as his proudest achievements.
“Headspace was actually started by the Howard government, but after many years of pushing for it, I managed to get one opened in Rockingham through funding from the Gillard government,” he said.
“It is the single one of which I am most proud.
“Any parents and youth should call in.
“I really wish it was around when I was younger.
“Others have been the investment in schools and better buildings, the Rockingham entrance road from the freeway, investment in new infrastructure and better facilities at hospitals.
However, Mr Gray said there were lowlights to his political career.
“The internal squabble,” he said.
Mr Gray said it was an honour to have worked alongside former Prime Minister Julia Gillard.
“I had deep affection for Julia; the work she did on the national disability scheme, no-one has ever done that,” he said.
“A future Labor government will implement that scheme.
“Julia was a gem.
“I do believe she was outed because she is a woman.”
He said his Rockingham colleagues had made his job easier.
“Barry Sammels is one of the best administrators in the country,” he said.
“It’s great to work with an aligned team; I’ve been fortunate to work with an outstanding group of people.
“I’d like mostly to thank the people of Rockingham and Kwinana for their support.”
“I’ve done it to the best of my ability.”
Mr Gray said he did not know what the future held but he said he would still need to work.