In the novel the phrase is "the world will be saved by beauty" (mir spasyot krasota), and the form that became a saying, "beauty will save the world," is also in the book, in the same speech by Hippolyte, right after. The prince never says it in front of the reader: it reaches us through other voices, always in a mocking or forbidding tone.
The first to quote it is Hippolyte, on the night of the prince's birthday: "Is it true, Prince, that you once said that beauty will save the world?" He heard it from Kolya and uses it to provoke a man he believes is in love. In Part Four, Aglaya puts the phrase on the list of things the prince must not say in front of the guests and warns him: "Don't show yourself before my eyes again."
What the book does with the idea is put it to the test. The beauty of Nastasya's portrait is a suffering, Aglaya's beauty is an enigma, and the beauty of the world is, for Hippolyte, a feast to which he was not invited: "What good is all this beauty to me," he says, facing the fly buzzing in the sunbeam. The prince, in his salon speech, points to a tree, a child, and the dawn as beautiful things "that even the most lost man finds beautiful."
The phrase can be read in opposite senses. For some, the novel confirms it, because the prince's compassion is a beauty that acts; for others, it refutes it, because no one is saved. The text does not decide, and the phrase stays as a question.