Many of times people ask this question that what would become of those NON-MUSLIMS in the after life who have done great things in life for the benefits and comforts of others like Mahatama Gandhi & Mother Teresa etc. The people like such are highly regarded by masses and their influences are immense due to their sincerity, steadfastness and sacrifies for their objectives in the eyes of their followers. The simple answer to that as per Dr. Zakir Naik's reply to the same questions is (in my own words):
Suppose if an student wishes to take the Maticulation Exam. The overall exam consists of the test of several courses e.g. Mathematics, English, Chemistry, Physics, History etc. Inorder for you to pass that exam, you have to secure atleast the passing marks (say 33%) in each individual subjects. Some student might score higher marks in some subjects and lesser in others. As long as he obtains equal or above the 33% marks he would be considered passed in the end. If he secures 90% or more in 4 subjects but 32% in the compulsory subject of Mathematics, the resultant outcome despite of his excellent numbers in the 4 other subjects would still reflect his overall failure in the Matriculation exam. Similarly in the test of life, a person is given several tasks by Allah (SWT), some of them are compulsory & some are optional. If a person accumulate loads of good deeds in say, humanity and honesty etc. but fails to pass the most essential task i.e. the recognition of the oneness/uniqueness of Allah and the guidance of His final message Al-Quran, that person would be treated as a failure in his overall standing on the day of judgement. He/She might be thought of very highly or praised immensely in this world as a reward of his good deeds but there won't be any good deed left in his account in the hereafter due to his failure in the most essential and compulsory of all tasks and would be placed in the ranks of losers.
O ye who believe! cancel not your charity by reminders of your generosity or by injury,- like those who spend their substance to be seen of men, but believe neither in Allah nor in the Last Day. They are in parable like a hard, barren rock, on which is a little soil: on it falls heavy rain, which leaves it (Just) a bare stone. They will be able to do nothing with aught they have earned. And Allah guideth not those who reject faith. (Al-Baqra:264)
Hence disbelievers, regardless of their greatness, nobility and piousness would not be able to enter Jannah as per the defined rules in Quran:
The Religion before Allah is Islam (submission to His Will): (Al-E-Imran: 19)
If anyone desires a religion other than Islam (submission to Allah), never will it be accepted of him; and in the Hereafter He will be in the ranks of those who have lost (All spiritual good). (Al-E-Imran:85)
O ye who believe! Fear Allah as He should be feared, and die not except in a state of Islam.(Al-E-Imran:102)
Having said that, on the day of judgement it would ultimately be in the Hands of Allah (SWT) to forgive anyone if He Wills and no one could dare to question Him or His authority. But as a generalized rule, the deeds of a person won't even matter or be judged or be placed on the weighing scale (Al-Meezan) if he missed out the pre-requisite of even getting to the step of being judged i.e. died on a religion other than Al-Islam.
May Allah(SWT) assist us in attaining the real faith and help us die in the state of imaan. Ameen!!