بسم الله الرحمن الرحيم
According to Shariah, Ilm-e-Ghaib (knowledge of Unseen) is the definite and direct knowledge of those things which have not happened yet or they had happened but Allah did not inform anyone about it. (Mazhari)
The example of first type is all those events and stories which are related to the Day of Judgment or the incidents that would take place in the world in future, for example, who, where and when will be born? What will he do? What will be his age? How many times will he breathe in his life etc. And the example of the second type is the fetus which is breathing inside the womb, but none knows if it is boy or girl, beautiful or ugly, whether it will have good character or bad character. This Ilm-e-Ghaib is the definite attribute of Allah. This knowledge was given to no Prophet including the Holy Prophet Muhammad (may peace and blessings of Allah be upon him). The following verses of the Holy Quran are clear evidence for the same:
قُل لَّا يَعْلَمُ مَن فِي السَّمَاوَاتِ وَالْأَرْضِ الْغَيْبَ إِلَّا اللَّهُ وَمَا يَشْعُرُونَ أَيَّانَ يُبْعَثُونَ . [النمل : 65]
“Say, no one in the heavens and the earth has the knowledge of the Unseen except Allah.” And they do not know when they will be raised again.”
وَعِندَهُ مَفَاتِحُ الْغَيْبِ لاَ يَعْلَمُهَا إِلاَّ هُوَ . [الأنعام : 59]
“With Him are the keys of the Unseen. None knows them but He.”
وَلَوْ كُنتُ أَعْلَمُ الْغَيْبَ لاَسْتَكْثَرْتُ مِنَ الْخَيْرِ . [الأعراف : 188]
“If I had the knowledge of the Unseen, I would have accumulated a lot of good things.”
(Abstracted from: Ma’arif al-Quran: 7/52, 3/345 etc.)
For more details and evidences the study of the above mentioned places of Ma’arif al-Quran would be more useful.
Allah knows Best!
Darul Uloom Deoband