Do I need a comma after the word book and does the sentence sound alright?

When I first saw the title of the book I knew the theme would pertain to the importance of one’s identity.

Yes, you need a comma after "book." That's an introductory clause up to that point. See #3 here:

http://grammar.ccc.commnet.edu/grammar/commas.htm

The sentence sounds fine except for "one's" -- who is that "one"?