The France Under-20 international, who is an alumnus of the INF Clairefontaine national academy, which also produced World Cup winners Thierry Henry, Blaise Matuidi, Olivier Giroud and Kylian Mbappe, has signed a deal until 2027.
He spent one season at Nantes before joining Chelsea's academy, where he remained until his move to West Ham in June 2021.
Ekwah scored nine goals and assisted three times in 39 Under-21 appearances for the Hammers.
The 21-year-old's move to the Stadium of Light comes as Tony Mowbray's ninth-placed Black Cats are pushing for a play-off position in the Championship.
Ekwah said: "The history and vision of the club really attracted me and I'm delighted to be here. I see myself as a number eight who can handle the ball well, but I can also do the defensive side of the game.
"It's great to see the club trusting young players and that's something that really appealed to me - it seems a great environment for me to develop as both a person and a player, and I can't wait to get started."
Manager Mowbray added: "We are delighted to get the deal done and welcome Pierre to Sunderland. He is a player we have been monitoring for some time, and we believe he will add something different to the dynamic of our midfield.
"Having met him, he has a brilliant personality - he wants to get better and show he can play first-team football. He brings a level of physicality and we're really looking forward to working with him."
Ekwah will wear the number 39 shirt and is expected to be available for selection when Sunderland travel to Fulham for Saturday's FA Cup fourth round clash.