All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and Messenger.
Marriage is among the good matters and it has many good and noble objectives, among which is keeping oneself chaste from committing what is forbidden [illegal sexual intercourse]. The Prophet said: ''O young people, whoever is able to marry should marry as it helps him lower his gaze and protect his private parts (from committing illegal sexual intercourse), and whoever is not able to marry, he should fast, as fasting diminishes his sexual desires." [Al-Bukhari and Muslim]
Based on this, you should take the initiative as soon as possible to marry. Allaah Says (what means): {So race to [all that is] good.} [Quran 2:148]
Therefore, if the girl whom you mentioned in the question is religious and righteous, then you should try your best to convince her parents to let you marry her as quick as possible. First, you should seek the help of Allaah, then the help of the people who can influence them, as marriage does not usually prevent from studies. Then, if you succeed to convince them, praise be to Allaah, otherwise you should leave her and look for another woman to marry and Allaah will facilitate for you another righteous wife, Allaah willing.
You should not wait until she finishes her studies, especially that marriage may be an obligation upon you. Indeed, the jurists are of the view that marriage is an obligation upon whoever fears to commit illegal sexual intercourse by not getting married. For more benefit, please refer to Fatwa 81853.
On the other hand, there is no doubt that a Muslim should perform the Istikhaarah prayer about the matters that he is willing to carry out and that are permissible, and he should put the matter in the Hands of Allaah as Allaah knows the unseen and what is in the hearts. For more benefit on how to perform the Istikhaarah prayer and to know its result, please refer to Fataawa 82964 and 81434.
As regards drawing lots to know the result of the Istikhaarah prayer, please refer to Fatwa 108176.
With regard to masturbation, it is a bad and forbidden habit, and it has its serious disadvantages on the Muslim in his religion and his worldly matters. For more benefit, please refer to Fatwa 81150.
Stopping masturbation is an easy matter, you only have to be determined to leave it and be sincere to your Lord in this. If you are truthful towards Allaah, then Allaah is truthful towards you (i.e. He will enable you to do what pleases Him).
In addition to fasting, you should avoid anything that incites your lust, and you should keep company with the righteous people and preoccupy your free time with what benefits you in your religion and worldly matters.
Allaah Knows best.