The 19-year-old, who has been with the Reds since the age of seven, made his senior debut in the Carabao Cup victory over Rochdale last month.
The deal will keep him at United until June 2022, with the option to extend for a further year.
Williams is another product of the club’s outstanding Academy system and is one of 12 Academy graduates who have featured in a first-team matchday squad this season.
The boyhood United fan, who was nominated for the Premier League 2 Player of the Month award in September, recently made his England Under-20s debut in a goalless draw with the Netherlands.