The short answer is that we do not know.
The reason to believe that Solomon is not saved is that he turned against God, for example:
1Ki 11:4 For when Solomon was old his wives turned away his heart after other gods, and his heart was not wholly true to the LORD his God, as was the heart of David his father.
Nowhere is it stated that Solomon turned again to God, and he is not included with the faithful in, for example, the list of Hebrews 11.
The evidence that he was saved is based on the assumption that Solomon is the author of Ecclesiastes. If this is the case then its “old man looking back” viewpoint suggests that it was written late in his life, and it is difficult to imagine that author being ungodly. Therefore it is possible that he underwent an unrecorded repentance late in his life.