Hernandez spent four seasons with Bayern Munich, having joined from Atletico Madrid in the summer of 2019 for €80m.
The France international costs PSG €40m this time round as his contract was set to expire next summer.
Hernandez made 107 appearances for Bayern Munich and won four Bundesliga titles as well as the Champions League in 2020, UEFA Super Cup, FIFA Club World Cup and one DFB- Pokal.
He only made eleven appearances for Bayern Munich last season after suffering a serious knee injury while representing France at the 2022 FIFA World Cup in Qatar.
"I'm really excited! I've been waiting to join PSG for a long time, and it's finally happened. It's a very special day for me and I'm very happy to be here," Hernandez told the official PSG website.
"A big injury like a ligament rupture is never easy," Hernandez added.
"It's already been seven months since I suffered this injury. Right now you can rest assured that I'm at 200%.
"I can't wait to get back to work with the team and, from day one, be at my best. My knee's fine. And frankly, everything's going really well.
"I'm very happy. It's true that this has been something I've been looking at for a long time, and now it's finally happened. I've always wanted to come here and it's true that it's a very special day for me and to come here with this ambition is something I've wanted for a long time."
The 27-year-old is PSG's fifth summer signing after Milan Skriniar, Marco Asensio, Manuel Ugarte and Lee Kang-in.
Hernandez won the World Cup with France in 2018.