"The Lord was pleased that Solomon had asked for this. So God said to him, 'Since you have asked for this and not for long life or wealth for yourself, nor have asked for the death of your enemies but for discernment in administering justice, I will do what you have asked. I will give you a wise and discerning heart, so that there will never have been anyone like you, nor will there ever be. Moreover, I will give you what you have not asked for - both riches and honor - so that in your lifetime you will have no equal among kings.'" NIV translation
Because Solomon was the humble servant, God elevated him to be the wisest man that ever has been or ever will be. That is hard for us to believe as we have become so educated with doctorates, masters, bachelors, and all kinds of learning certificates but none of these degrees comes close to the wisdom that God granted to Solomon. He also was given the riches and fame that he did not ask for and we are reminded that God always elevates the humble and brings down the proud. It is interesting to note that, unlike the wisdom, God did not say that there would never be a richer or more famous person than him.
"'And if you walk in my ways and obey my statutes and commands as David your father did, I will give you a long life.' Then Solomon awoke - and realized it had been a dream. He returned to Jerusalem, stood before the ark of the Lord's covenant and sacrificed burnt offerings and fellowship offerings. Then he gave a feast for all his court." NIV translation
In addition to the gifts, God offered him a long life but this was not a gift as it required Solomon to act in a proper manner. Solomon awoke and realized that he had been visited by God in his dream. We see the impact that this had on him as he went back to Jerusalem and worshiped where he was supposed to.
"Now two prostitutes came to the king and stood before him. One of them said, 'My lord, this woman and I live in the same house. I had a baby while she was there with me. The third day after my child was born, this woman also had a baby. We were alone; there was no one in the house but the two of us.'" NIV translation
Now, we see two women come to the king to settle a dispute between them. They were women who had children without being married to one man (harlots).