Afellay announced last month he would not be signing a new contract when his current deal expires at the end of the season with PSV.
A number of clubs, including the likes of Liverpool and Arsenal were linked with the Holland international, but Barcelona have won the race for the 24-year-old's signature.
The deal, which was announced on both clubs' websites on Monday evening, is still pending an agreement between the Spanish champions and the player, but if all goes to plan then the Holland international will move to the Nou Camp when the January transfer window opens.
A statement on Barca's website read: "PSV Eindhoven and Barcelona have reached an agreement on a deal to bring Ibrahim Afellay to Barca, subject to successfully settling personal terms between the player and the Catalan club over the coming weeks.
"Until the deal is finally settled, Ibrahim Afellay wishes to concentrate on the upcoming important games for PSV."
Afellay's agent, Rob Jansen, has confirmed a deal has been agreed in principle to see the classy attacker make the move to Spain in the New Year.
"That [agreeing personal terms] is definitely going to take some time," Jansen told Sports Promotion's official website.
"There is certainly no final agreement. When the time comes we will notify the media and the fans through our website."