Wa `alaykum As-Salamu wa Rahmatullahi wa Barakatuh
Istikharah is seeking the help of Allah in making decisions or choices. It is not meant to absolve us of our duty to work hard. The Prophet (peace be upon him) taught us against abandoning ourselves to the fate: He told the person who let his camel wander free wander in the desert hoping that God to take care of it: Go and tie your camel securely, then put your trust in Allah!”
So, as a student, you cannot merely make istikharah and wait for the best grade unless you prepare for the exam by putting forth the best of your efforts. Once you have done that, you can make istikharah and ask Allah to bless your efforts.
There is no need for you to get into such details; instead, it is sufficient to ask Allah to bless your efforts to gain the best grade.
For details on the meaning and purpose of istikharah, you may access the answers on this site.
Almighty Allah knows best.
Views expressed by hosts/guests on this program (live dialogue, Facebook sessions, etc.) are their own and their appearance on the program does not imply an endorsement of them or any entity they represent.