Sheikh Ahmad Kutty, a senior lecturer and Islamic scholar at the Islamic Institute of Toronto, Ontario, Canada, states: Temporary marriage or marriage for convenience is not permissible in Islam. Marriage can only be contracted with the intention of forging a permanent union. Allah calls it a solemn contract, and like all contracts, Muslims are bound by them and are expected to keep them as a basic act of faith. The Prophet (peace and blessings be upon him) said, “Of all terms of contract we enter into, there is nothing more worthy of strict observance like those of marriage!” Moreover, marriage in Islam is a noble institution with high noble purposes such as achieving tranquility and peace through a successful union, partnership and companionship, commitment in shouldering the responsibilities of life, and rearing and nurturing of children. It is for this reason that Islam insists that we look for compatibility in spiritual and moral values as the supreme criterion in selecting a marriage partner.
Based on the above considerations, we are not allowed to resort to marriage simply for the purpose of sexual gratification. So we are not allowed to embark on marriage while we have the intention of terminating the marriage once we have finished our studies.
The only option left for you, therefore, is to seriously consider marrying her if she is of a reliable and trustworthy character. Otherwise, seek other healthy ways of sublimation by taking your mind away from lustful thoughts and practicing the discipline of fasting. For the Prophet said, “Fasting helps to curb one’s desires!”