The 19-year-old defender has become a prominent figure within the first team since his debut in May.
"I'm really happy to commit my future here," Galloway told the club's official website. "This is a club that has got so much young talent and is moving forward. It's great to be able to commit to being a part of that.
"My family came up to watch me sign so it was nice to have them around. They have been with me all the way."
Martinez added: "Brendan arrived at the football club with a very clear development path in front of him but the reality is that he has surpassed that.
"Then he joined the first-team environment and he has developed into an important player and a very good performer. At Everton we will always reward those who deserve it.
"This is another step forward. He is still a young man but one with a fantastic personality. This is a day for him to celebrate with his family, but also one for everyone connected with Everton to recognise a young man who has come through and done so well."
In all, Galloway has made 18 appearances since his arrival at Everton from MK Dons in the summer of 2014. body check tags ::