Which book in the Bible does King Solomon pour out his heart to God? Does he make peace with God?
Solomon’s life can be read from 1 Kings 1-11, 2 Chronicles 1-11, and in the books credited to his name as an author, Proverbs, Ecclesiastes, and Song of Solomon. There’s a lot of information in all of these books about his life.
First Kings 1-11 present Solomon in a good light with some major cracks in his foundation as a leader. It mentions the long and political succession of David. This may be met by the author to foreshadow the rocky end of his kingship and the problematic rule of all of his children afterward.
While he was a king with great wisdom, he also amassed wealth for himself and had many wives and concubines, all of which go against the premonitions of the Israelites having a king from Moses and Samuel.
Solomon demonstrates some of the good and some of the bad of being King of Israel. Such a position can be abused or taken advantage of. Probably the best way to answer your question about when and where he may have made peace with God can be found in the book of Ecclesiastes.
Standard scholarship tells us that Solomon wrote the book of Ecclesiastes. It is written later on in his life when he is an older man. The book goes through a series of experimenting with different ways of life in different goals and purposes in life.
Ultimately, the continual refrain of the book is that everything is vanity, empty and worthless. No matter what human pursuit he tried out, he found it unsatisfying in the end. But at the end of the book, after trying out all of these fruitless and empty pursuits, Solomon comes to the wise conclusion that fearing God and obeying his commandments is the chief duty of humanity (Ecclesiastes 12:13).
It seems that even after all of his wandering and trying many different approaches to life, he finally came back to the truth about human existence. Fearing God is all about the fear of the Lord, revering God for who he is and what he does. It would appear from Solomon’s conclusion that he may have returned to God in his old age. But no one can know for sure historically.