The 58-year old, whose previous deal expired in the summer, has been rewarded for comfortably keeping the Hammers in the Premier League after winning promotion last season
There had been much uncertainty all season regarding whether his contract would be extended or not, with many even linking the Hammers boss to the vacant Everton job in the summer.
But both sides had been optimistic when discussing the ongoing negotiations as the season went on and chairman David Gold finally revealed that talks had borne fruit.
|100/1||Andy Carroll's goal v West Brom in March is 100/1 with BetVictor to be named 'Match of the Day' Goal of the Season|
After Allardyce led the Londoners back to the Premier League through the Championship play-offs last season, his side are currently in 10th place, targeting their first top-half finish for four years.