Ayew joins after spending two season with the Swans, with the club relegated at the end of 2017-18 season.
The 26-year-old attacker was named Swansea’s Players’ Player of the Season last term after scoring 11 goals in all competitions for the club.
“I am very pleased to be here. It’s been a long transfer window but finally I got a move," Ayew told Crystal Palace's official website.
"The important thing for me now is to get fit and to be in good shape, and I know the manager wants to use me up front and make things happen.
"I chose to come to Palace to continue improving. It’s a step up for me and I’m ready for the challenge and to get to where I think I can get to."
Ayew has been capped 49 times by Ghana, scoring 11 goals.
Palace begin their Premier League season on Saturday against Fulham.