The original Prince of Persia (1989) plot was simple: the nameless player character is locked up in prison. He has to escape, find the Princess ans save her from jealous and treacherous vizier named Jaffar. Original trilogy consists of Prince of Persia, Prince of Persia 2: The Shadow and the Flame and Prince of Persia 3D.
Prince of Persia: The Sands of Time, released in 2003 by Ubisoft, was the series' second wind. It was praised for the animation, quality graphics and astonishing acrobatics.
From: IGN:
The game begins in medieval Persia shortly after the Prince and the king have defeated the Maharajah [of India] and looted his palace. When the Prince takes a mysterious dagger he accidentally unleashes the Sands of Time, an evil force that infests the kingdom and transforms its inhabitants into demonic beings. The character's quest is, ultimately, to set right his own stupid mistake and reverse the dark magic. No easy task.The concept of Sands of Time reappears in Prince of Persia: Warrior Within (2004), and Prince of Persia: The Two Thrones (2005).
The film included elements from all these games: the plot of The Sands of Time, Prince's armor of the Warrior Within, the dagger looks like the one in The Two Thrones and etc.
Prince of Persia: The Forgotten Sands, released in 2010, set between the first and second games. From: Ubisoft UK website:
Visiting his brother’s kingdom following his adventure in Azad, the Prince finds the royal palace under siege from a mighty army bent on its destruction. Deciding to use the ancient power of the Sand in a desperate gamble to save the kingdom from total annihilation, the Prince will embark on an epic adventure in which he will learn to bear the mantle of true leadership, and that great power often comes with a great cost.