Praise be to Allah.
Allah has enjoined du’aa’ (supplication) in more than one place in His Holy Book.
“And your Lord said: Invoke Me [i.e. believe in My Oneness (Islamic Monotheism) and ask Me for anything] I will respond to your (invocation). Verily, those who scorn My worship [i.e. do not invoke Me, and do not believe in My Oneness, (Islamic Monotheism)] they will surely enter Hell in humiliation!” [Ghaafir 40:60]
This is something that is general in meaning, which includes asking Allah for what one needs in this world and in the Hereafter, as the bounty and generosity of Allah are so great, and there is nothing that is too great for Him to give, and if He were to give everyone what he asks for, that would not detract from His dominion in the slightest.
Allah says (interpretation of the meaning):
“and ask Allah of His Bounty. Surely, Allah is Ever All‑Knower of everything” [al-Nisa’ 4:32]
It says in the lengthy hadeeth of Abu Dharr al-Maqdisi that Allah says:
“O My slaves, all of you are astray except those whom I guide, so ask Me for guidance, and I will guide you. O My slaves, all of you are hungry except those whom I feed, so ask me for food and I will feed you. O My slaves, all of you are naked except those whom I clothe, so ask Me for clothing and I will clothe you. … O My slaves, if the first of you and the last of you, your humans and your jinn, were to stand on a single plain and ask of Me and I were to give each one what he asked for, that would not cause any loss to Me greater than what is lost when a needle is dipped into the sea.”
Narrated by Muslim (2577).
Ibn Rajab said in Jaami’ al-‘Uloom wa’l-Hukam (1/225):
This hadeeth indicates that Allah likes His slaves to ask Him for everything that is in their spiritual and worldly interests such as food, drink, clothing etc, and to ask Him for guidance and forgiveness. In the hadeeth it says: “Let one of you ask his Lord for everything that he needs, even a lace for his shoe if it breaks.” Some of the salaf used to ask Allah in their prayers for everything, even salt for their dough and food for their sheep. In al-Israa’eeliyyaat it is narrated that Moosa (peace and blessings of Allah be upon him) said: O Lord, I have some worldly needs but I feel too shy to ask You. He said: Ask Me even for the salt for your dough and food for your donkey.
Whatever a person needs, if he asks Allah for it, then he has demonstrated his need of Him, and that is something that Allah loves. Some of the salaf would feel too shy to ask Allah for their worldly needs, but following the Sunnah is better. End quote.
It was narrated from ‘Aa’ishah (may Allah be pleased with her) that the Messenger of Allah (peace and blessings of Allah be upon him) said: “If one of you wishes for something, let him ask Allah for a great deal of it, because he is asking his Lord, may He be glorified and exalted” [?} Narrated by Ibn Hibbaan (2403) and al-Tabaraani in al-Awsat (2/301). Al-Haythami said in Majma’ al-Zawaa’id (10/150): its men are the men of saheeh. It was classed as saheeh by al-Albaani in al-Silsilah al-Saheehah (1325).
It was narrated that ‘Aa’ishah (may Allah be pleased with her) said: Ask Allah for everything, even shoelaces, because if Allah does not make it easy for you to obtain it you will not obtain it.”
Narrated by Abu Ya’la (8/44) and Ibn al-Sunni in ‘Aml al-Yawm wa’l-Laylah (349). It was also narrated by al-Bayhaqi in Shu’ab al-Eemaan (2/42) with a different isnaad.
It says in Majma’ al-Zawaa’id (10/150): its men are the men of saheeh.
Al-Albaani said in al-Silsilah al-Da’eefah (1363): This is a jayyid mawqoof isnaad whose men are all thiqaat (trustworthy) and are the men of Muslim, End quote.
al-Manaawi said in Fayd al-Qadeer (4/110):
There is no way to obtain any blessing, major or minor, except by asking the One Who is in control of all things. In the Gospel it says: Ask and it shall be given to you, seek and you shall find, knock and it will be opened unto you; everyone who asks will be given, everyone who seeks will find, and everyone who knocks will have it opened unto him. Allah revealed to Moosa: Say to the believers: do not try to make Me hasten when you call upon Me, and do not think I am miserly. Do they not know that I hate the miser, so how could I be miserly, O Moosa? Do not think that I will not give you if you ask Me for great things, and do not feel too shy to ask Me for small things. Ask even for flour and food for your sheep, O Moosa. Do you not know that I have created the mustard seed and everything greater than it, and I have not created anything but I know that people need it, so whoever asks Me for something knowing that I am able to give and withhold, I will give him what he asks for and forgive him.
‘Urwah ibn al-Zubayr said: I ask Allah when I am praying, and I even ask Him for salt for my family. End quote.
Shaykh Ibn ‘Uthaymeen (may Allah have mercy on him) said in al-Sharh al-Mumti’ (3/284):
There is nothing wrong with asking for some worldly things, such as saying: “O Allah, give me a spacious house” or “O Allah, give me a beautiful wife” or “O Allah, bless me with abundant wealth” or “O Allah, give me a comfortable car”. That is because du’aa’ in itself is an act of worship, even if it is asking for worldly things, and a person has no one to turn to but Allah. End quote.
See also the answer to question no. 22498.
So there is nothing wrong with you asking Allah to bless you with a palace in this world and in the Hereafter, although it is better for a believer not to be so interested in the pleasures of this transient world, and to focus on that which is with Allah of the delights of Paradise. If he does ask for some of the riches and delights of this world, then he should limit that to the beneficial pleasures that will not make him forget the Hereafter. Look at the situation of the one whose story Allah tells us in the Holy Qur'aan (interpretation of the meaning):
“And Allah has set forth an example for those who believe: the wife of Fir’awn (Pharaoh), when she said: ‘My Lord! Build for me a home with You in Paradise, and save me from Fir’awn (Pharaoh) and his work, and save me from the people who are Zaalimoon (polytheists, wrongdoers and disbelievers in Allah)’” [al-Tahreem 66:11]
It is also makrooh to transgress in du’aa’ by mentioning some details that are inappropriate, such as asking for a palace with a certain number of floors, or a certain number of rooms, and other such details. This has been discussed in the answer to question no. 41017.
You should also note that Allah chooses nothing but good for His believing slaves, so your intention when praying for some worldly gain should be asking that Allah decree good for you no matter where it may be, and to cause you to be content with whatever He decrees for you, whether that goodness is in meeting your need sooner rather than later, or in withholding it from you and storing (the reward) for you with Him.
See also the answer to question no. 3699.
And Allah knows best.