the story is mentioned in Surat al-Kahf (the Cave). It is related that the Prophet (SAWS) said that whoever reads this surah every Friday will be shown a light between heaven and earth throughout the whole week.
The story is about a group of young people, about six or seven, who were in their teens. Allah (SWT) says about them what can be translated as, “Surely they were young men who believed in their Lord, and We increased them in guidance.” (TMQ, 18: 13).
This story is considered to be a Qur’anic miracle and a true evidence of Muhammad’s (SAWS) prophethood. Surat al-Kahf was revealed in Makkah at a time when the people of Quraysh were trying to falcify the Prophet’s (SAWS) prophecy. They sent two men, an-Nadr Ibn-al-Harith and Oqbah Ibn-abi-Ma’eet, to the Jewish monks in Madinah asking them for a question that the Prophet Muhammad (SAWS) would not be able to answer. They wanted the question to be about a story that took place after the revelation of Tawrah (Torah) and Injil (Gospel); one that no-one except a true prophet would know. The monks suggested that they should ask him about a group of young men who lived a very long time ago. They went to the Prophet (SAWS) and asked him about them. The Prophet (SAWS) told them that he would answer them the following day but he did not say “if Allah wills”. Allah (SWT) says what can be translated as, “And definitely do not say, regarding anything, ‘Surely I am performing that tomorrow,’ Except (if you add), If Allah (so) decides…” (TMQ, 18: 23-24).
The revelation was delayed, and the people of Quraysh started to doubt. After 15 days, the Prophet (SAWS) received a Qur’anic revelation relating the story. Allah (SWT) says what can be translated as, “Or even do you reckon that the Companions of the Cave and Ar-Raqîm (It is the name of a leaden plate, on which were written the names of the seven sleepers) were among Our signs a wonder? As the young men (Literally: the pages) took (their) abode in the cave, (and) so they said, ‘Our Lord, bring us mercy from very close to You, and dispose for us rectitude in our Command.’ (i.e., in Your Command to us; our: in our affair). Then We struck upon their ears for a (great) number of years in the cave. Thereafter We made them to rise again that We might know whichever of the two parties would best enumerate the span they had lingered. We, Ever We, narrate to you their tidings with the truth. Surely they were young men who believed in their Lord, and We increased them in guidance.” (TMQ, 18: 9-13)
The whole story is related in the Qur’an so that we can learn from it and at the same time it answers Quraysh’s questions. This is a miracle because the Prophet (SAWS) knew nothing about this story before. The first question was, “How long had they slept?” The answer was, “And they lingered in their cave three hundred years, and to that they increased nine (more).” (TMQ, 18: 25). The second question was, “How many were they?” The answer was, “They will say, ‘Three, their dog (was) the fourth of them.’ And (others) will say, ‘Five, their dog (was) the sixth of them,’ guessing at the Unseen. (Some others) will say, ‘Seven, and their dog (was) the eighth of them.’ Say, ‘My Lord knows best their right number; none knows them, except a few.’…” (TMQ, 18: 22). The Qur’an mentions that most likely they were seven. Also, Ibn-Abbas (RA) narrated that the Prophet (SAWS) said that he was among the few who knew their number and that they were seven. This defies the Jews and their monks because their exact number is not mentioned in their books. They were few in number but they changed the world, which proves that it does not take a large number of people to create a change.