Bailly joined United from Spanish La Liga side Villarreal in the summer of 2016 and has made 100 appearances in total for the club.
Injuries have hampered Bailly during his time at Old Trafford, restricting him to just 15 appearances across all competitions this season.
The 27-year-old Ivory Coast international maintains he is happy at Old Trafford regardless and is keen to win more trophies with the Red Devils.
"I’m very happy," Bailly told the club's official website. "This decision is something I didn’t have to think about, I love this club and I love playing for Manchester United. I’m happy and so are my family, everything is good.
"Now the moment with my injury has passed and I’m fit and feel good, and that’s it. A new contract is like a new challenge and I’m ready for this. For me, it’s the dream to be here. Now it’s my fifth season and I hope to be here a long time.
"We are in a good position. We have the Europa League and we are second in the league and that is very good. We hope we can win this trophy [Europa League] – it is very important for us and for the fans and for the season. We want to finish well in the Premier League as well, I’m sure we will."
Bailly has won one Europa League and one League Cup during his time with United.