Here is an article about the story: https://journals.openedition.org/crm/13772#text
It was written by Abraham Ibn Hisday in the 13th century, roughly based on the Christian legend of Barlaam and Josaphat.
Mi Yodeya is a question and answer site for those who base their lives on Jewish law and tradition and anyone interested in learning more. It only takes a minute to sign up.Sign up to join this community
An English summary of the book is given in Meyer Waxman's History of Jewish Literature, vol. 2 starting from p. 590.
There's also a Catalan translation of the story, El príncep i el monjo with introduction and study by Tessa Calders i Artís (1987).