The young stopper is highly rated at Old Trafford and the club and is has progressed well since joining the academy in 2012 following a spell on trial.
In an interview with the club website, the 21-year-old said: "I have been at United for a number of years now and since the first day here I have enjoyed every minute,"
"Over the last season I feel I have made great progress as a goalkeeper and this will stand me in good stead for continuing my development as a Manchester United player."
"There have been many memorable moments for me at this club - however, making my debut for the first team at Old Trafford was unbelievable for me and my family."
United boss Jose Mourinho also gave his thoughts on the matter, saying: "Joel progressed really well during the course of the last season through hard work and commitment every day in training."
"I know I have said this before but I really do believe, if he continues his development and continues to work hard, he really can become the best Portuguese goalkeeper of the next generation."
A new #MUFC contract for @ElgatoPereira1 – nice going, Joel! https://t.co/XGVZBkBsOJ pic.twitter.com/kVnaiWTZm7
— Manchester United (@ManUtd) 8 de julho de 2017