A game lacking in clear-cut chances looked to be heading for a penalty shoot-out until Tabea Kemme brought down substitute Lianne Sanderson.
Williams kept her nerve to send goalkeeper Nadine Angerer the wrong way from the spot-kick, despite the attempts of Germany replacement Alexandra Popp to put her off.
The victory was England’s first-ever win over Germany, who had started the tournament as favourites, in a women’s international and it came at the 21st attempt.
England could have gone behind in the first minute were it not for the reactions of keeper Karen Bardsley.
Sara Dabritz supplied an inviting cross and Lena Petermann headed low towards the near post but Bardsley did well to get down and turn the ball around the post.
England’s hopes were ended by an own-goal in the semi-finals and they nearly fell victim to another as Jo Potter and Bardsley got in a mix-up while dealing with a high ball and Steph Houghton made a brilliant acrobatic clearance on the line.
Germany had started the better but the Lionesses had a golden opportunity in the 12th minute as Lucy Bronze crossed towards Houghton on the edge of the six-yard box but the skipper could not get a solid connection and Angerer made a routine save.
England were growing into the game but midway through the half it was Germany who had another chance as Dabritz chested the ball down on the edge of the box and hit a volley which cleared the bar.
The Germans were beginning to have the better of the game but England defended resolutely and Celia Sasic’s attempt to get to a high cross was the best of their chances as the interval approached, with Dabritz also having a shot blocked.
It was England who started the second half the better but Bardsley was required to make another impressive save in the 53rd minute.
Sasic put the cross into the box and Dabritz met it with a volley but the goalkeeper did well to turn the ball around the post.
That chance seemed to spur Germany into action and they began to dominate possession, with Simone Laudehr seeing a header from a corner saved.
Kemme tried her luck from distance and only just missed the far post as the game approached the final 20 minutes with the two-time champions looking the more likely to score.
But Jill Scott should have handed England the lead with 15 minutes to play when Bronze and Eniola Aluko combined to find her in space in the penalty box but the midfielder delayed her shot and was eventually closed down.
The addition of the pacy Aluko looked to have given England a spark but chances were few and far between with extra-time looming.
Sampson’s side finished regulation time by far the stronger and were swarming all over their opponents but they could not find the goal to avoid extra-time.
The first half of the extra period was typically cagey but Houghton was needed to block away Laudehr’s cross and the midfielder then put a free header wide from the resulting corner.
The game looked like it would be decided from the spot and so it proved just two minutes into the second half of extra-time as Kemme was penalised for holding back Sanderson in the box.
Ri Hyang-ok pointed to the spot and, after some falling out between the players, Williams stepped up and slotted the ball coolly low to the keeper’s right.
Germany applied late pressure, with Bianca Schmidt missing a gilt-edged header to take the game to penalties, but it was England who held their nerve to make history.