Istikharah prayer
Question

I would  like to know more about the prayer of Istikharah, What to recite, and the doa'a, how many rak’ahs and what benefit I can get. Hanafi,  Shafi’i, Hanabali are the prayers same way.
Praise be to Allah.Istikharah prayer is a Sunnah which the Prophet (peace and blessings of Allah be upon him) prescribed for anyone who wants to do an action but is hesitant about it. 
What is Istikharah prayer?
Istikharah in Arabic means seeking guidance to make a decision concerning something. It is said in Arabic Istakhir Allaha yakhir laka (Seek guidance from Allah and He will guide you (to the right decision)).
In Shari`ah terminology, Istikharah means seeking guidance (to the right decision), i.e., seeking guidance as to what Allah knows is the best and most appropriate choice, by means of prayer or the du`a narrated concerning Istikharah. 
Is Istikharah sunnah?
The scholars unanimously agreed that Istikharah is Sunnah. The evidence that it is prescribed is the hadith narrated by al-Bukhari from Jabir (may Allah be pleased with him) who said: 
“The Messenger of Allah (peace and blessings of Allah be upon him) used to teach his Companions to make Istikharah in all matters, just as he used to teach them surahs from the Quran. He said: ‘If any one of you is deliberating about a decision he has to make, then let him pray two rak`ahs of non-obligatory prayer, then say: Allahumma inni astakhiruka bi ‘ilmika wa astaqdiruka bi qudratika wa as-aluka min fadlika al-'adhim , fa innaka taqdiru wa la aqdir, wa ta’lamu wa la a’lam, wa anta ‘allam al-ghuyub. Allahumma fa in kunta ta’lamu hadha’l-amra (then the matter should be mentioned by name) khayran li fi ‘ajil amri wa ajilihi (or: fi dini wa ma’ashi wa ‘aqibati amri) faqdurhu li wa yassirhu li thumma barik li fihi. Allahumma wa in kunta ta’lamu annahu sharrun li fi dini wa ma’ashi wa aaqibati amri (or: fi ‘ajili amri wa ajilihi) fasrifni ‘anhu [wasrifhu ‘anni] waqdur li al-khayr haythu kana thumma radini bihi (O Allah, I seek Your guidance [in making a choice] by virtue of Your knowledge, and I seek ability by virtue of Your power, and I ask You of Your great bounty. You have power, I have none. And You know, I know not. You are the Knower of hidden things. O Allah, if in Your knowledge, this matter (then it should be mentioned by name) is good for me both in this world and in the Hereafter (or: in my religion, my livelihood and my affairs), then ordain it for me, make it easy for me, and bless it for me. And if in Your knowledge it is bad for me and for my religion, my livelihood and my affairs (or: for me both in this world and the next), then turn me away from it, [and turn it away from me], and ordain for me the good wherever it may be and make me pleased with it).” (Narrated by al-Bukhari in several places in his Sahih (1166) 
Why we pray Istikharah 
The reason why Istikharah prayer is prescribed is that it is submission to the command of Allah and a practical demonstration that one has no power and no strength of one’s own. It means turning to Allah and seeking to combine the goodness of this world and of the Hereafter. In order to achieve that, one has to knock at the door of the King, Allah, may He be glorified, and there is nothing more beneficial in this regard than prayer and du`a, because they involve venerating Allah, praising Him and expressing one’s need for Him. Then after praying Istikharah one should do that which one feels is best. 
Cases where  Istikharah is recommended
In what circumstances should one pray Istikharah? The four Schools of Fiqh agreed that Istikharah is prescribed in cases where a person does not know the right decision to make .
In matters where it is known whether a thing is good or bad, such as acts of worship, doing good deeds, sins or evil actions, there is no need to pray Istikharah in these cases.
But if a person wants to find out the right time to do something, such as whether to do Hajj this year, because there is the possibility of encountering an enemy or some tribulation, or whether to go with a certain person or not, then he may pray Istikharah with regard to such decisions. But there is no room for Istikharah when it comes to things that are obligatory, haram or makruh. Rather Istikharah has to do with things that are recommended or permissible.
Istikharah is not ordinarily required with regard to things that are recommended, rather it should be done in cases where there is a conflict, i.e., when a person has a choice of two things and must decide which one to start with or which one not to do. With regard to permissible things, he may pray Istikharah as a regular matter. 
When should he start praying Istikharah?
The person who wants to pray Istikharah should have an open mind, and not have decided on a specific course of action. The phrase “If any one of you is deliberating” indicates that Istikharah should be prayed when one starts to think of the matter, when through the blessing of prayer and du`a what is good will become clear to him, in contrast to when the idea has taken root and his resolve to do it is firm, in which case his inclination will sway him, and there is the fear that wisdom may not prevail because he is inclined to do that which he has already decided to do. 
It may be that which is meant by deliberation here is resolve, because a passing thought does not matter. And a person should not pray Istikharah except when he has decided to do something but does not have a strong inclination towards it. Otherwise, if a person were to pray Istikharah for every thought that crosses his mind, he would never stop and he would waste all his time doing that. 
Consulting others before praying Istikharah
Al-Nawawi said: 
“It is mustahabb, before praying Istikharah, to consult someone whom you know is sincere, caring and has experience, and who is trustworthy with regard to his religious commitment and knowledge. Allah says (interpretation of the meaning): “and consult them in the affairs” [Al ‘Imran 3:159]”
What to recite in Istikharah prayer
There are three opinions as to what should be recited in Istikharah prayer: 

The Hanafis, Malikis and Shafi’is said that it is mustahabb, after reciting al-Fatihah, to recite Qul ya ayyuha’l-kafirun in the first rak`ah and Qul huwa Allahu ahad in the second.  Al-Nawawi said, explaining the reason for that: It is appropriate to recite these in prayer, to show sincerity and expressing your leaving your affairs to Allah. They said that it is also permissible to add other verses from Quran where the context refers to the idea of making a choice or decision.
Some of the Salaf said that in praying Istikharah it is good to add, after reciting al-Fatihah, the following verses in the first rak`ah:

“And your Lord creates whatsoever He wills and chooses, no choice have they (in any matter). Glorified is Allah, and exalted above all that they associate (as partners with Him).
And your Lord knows what their breasts conceal, and what they reveal.
And He is Allah; La ilaha illa Huwa (none has the right to be worshipped but He), all praises and thanks be to Him (both) in the first (i.e. in this world) and in the last (i.e. in the Hereafter). And for Him is the Decision, and to Him shall you (all) be returned.” [al-Qasas 28:68 – interpretation of the meaning]
And the following verse in the second rak`ah:
“It is not for a believer, man or woman, when Allah and His Messenger have decreed a matter that they should have any option in their decision. And whoever disobeys Allah and His Messenger, he has indeed strayed into a plain error.” [al-Ahzab 33:36 – interpretation of the meaning]

The Hanbalis and some of the fuqaha did not say that any particular verses are to be recited when praying Istikharah.

When to make du`a in Istikharah prayer
The Hanafis, Malikis, Shafi`is and Hanbalis stated that the du`a should be recited immediately after the prayer . This is in accordance with what was stated in the hadith narrated from the Messenger of Allah (peace and blessings of Allah be upon him). (See al-Mawsu’ah al-Fiqhiyyah, part 3, p. 241) 
Shaykh al-Islam Ibn Taymiyah said in al-Fatawa al-Kubra: Part 2, p. 265: 
“Question concerning Du`a al-Istikharah: should this du`a be recited during prayer or after saying the salam?  The answer is that it is permissible to recite the du`a of Istikharah before or after the salam, whether you are praying Istikharah prayer or another prayer. Reciting du`a before the salam is preferable, as the Prophet (peace and blessings of Allah be upon him) used to recite a lot of du`a before the salam, and the worshipper before saying the salam is still in a state of prayer, so it is better to recite the du`a then.”
 And Allah knows best