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, sallallaahu ‘alayhi wa sallam, is His slave and messenger.
Saying that you intend to memorize such-and-such Surah if you obtain a driving license is not considered a vow—unless you had the intention of taking one—because a vow has pillars without which it is not considered binding. Its pillars include the statement; which makes it binding only if it includes certain words, like by saying: 'I vow to do such-and-such', or, 'It is due for Allaah Almighty upon me to do such-and-such', or, 'If such-and-such happens to me, I am committed to do such-and-such acts of worship'. However, merely saying, 'If what I want takes place, I will do such-and-such', without the intention of vowing does not constitute a valid statement of vowing, and you are not committed to do anything based upon that. Nevertheless, if you intended to take a vow by the words that you have said, then you should fulfill your vow because making a vow through indirect indication is considered binding provided that the person intends a vow.
In that case, you have to fulfill your vow and memorize Surah Al-Kahf. You do not have to memorize it all in one day. You may memorize it in many days. Surah Al-Kahf is not difficult. Allaah Almighty says (what means): {And We have certainly made the Quran easy for remembrance, so is there any who will remember?} [Quran 54: 17] Ibn Katheer said: “This means: 'We have made its wording easy and facilitated its meanings for those who want …'”
Al-Qurtubi said: “…this means that We facilitate memorizing the Quran and help whoever wishes to memorize it. If there is anyone who wishes to memorize it, he will be helped…” If you are unable to memorize it and have lost hope of this, then you have to offer expiation for oath breaking.
Allaah Knows best.