The 25-year-old's contract includes the option for a fourth year.
Gray, who won the Premier League with Leicester in 2016, has joined up with the Everton squad in Orlando for the Florida Cup.
"I'm delighted to be back in the Premier League at such a big club and I'm excited to play with the team and get to work," Gray told Everton TV.
"Speaking to the manager and [director of football] Marcel Brands, I had a really good feel for the club and I feel this is a place where I can continue to develop.
"The manager, with his ambition and what he has won in the past, is important and we'll look to push forward and compete with the top clubs. I think a club of this magnitude has all the potential to be right up there."
Birmingham-born Gray left Leicester in January 2021 and signed an 18-month deal with Bayer Leverkusen but he only made 12 appearances for the German side last season, scoring one goal.