The Scot, now in his second spell with the club, guided the Hammers to a sixth-placed finish in the Premier League last season securing European football for only the third time in their history.
He also amassed a club-record points total in the process and has now been rewarded for his efforts with a new long-term deal.
“I am delighted to have committed my future to West Ham United,” Moyes said upon the announcement. “This is where I want to be and I’m happy.
"I’m excited to be given this opportunity to build on what we all have already achieved here. The owners and I are fully aligned with how we want to keep developing and improving the football club.
“The Board and everyone at the club have been fantastic to work with, giving me great support and I feel that we are all united in what we want to achieve in the coming years and how we might be able to achieve those things.”
Joint-chairmen David Sullivan and David Gold added: “This is fantastic news and we are delighted that David has committed his long-term future to the Club, ensuring great stability going forward.
"His strong work ethic and determination to build success in the right way have proved a perfect fit for West Ham United, and we are all aligned with what needs to be done to keep progressing and improving.
"The experience of the past 12 months has created a fantastic unity throughout the club and we are very excited about what the future holds for our supporters.”