Williams, 23, who has played 69 games for Palace, spent the 2016-17 season on loan at Ipswich Town.
He missed most of the season after undergoing a shoulder operation.
"I will be working hard through pre-season so I am ready for the challenge ahead at the start of another campaign," he said.
"I am delighted to be signing this new contract at a club that holds a special place in my heart having been here since I joined the academy at the age of eight."
Williams has won 17 caps for Wales and was part of the squad that reached the 2016 European Championship semi-finals.
Wales midfielder Jonny Williams has signed a contract extension with Crystal Palace, which will see him stay at Selhurst Park until 2019.