That's a tricky question, but I think it's a fascinating one and certainly one that many people are concerned about. We talk about foxhole faith, when people cry out in desperate moments of crisis or postpone to their deathbed the moment of committing their lives to Christ. Some people say that it doesn't make sense for somebody who has been a Christian all their life to be in the same state as somebody who did as they pleased all their life and waited until the last second to get their accounts square with God.
There's a parable in the New Testament in which Jesus speaks about those who agree to work for a certain wage, and then at the last minute some other people are hired and only work for a few minutes but they get the same pay. The first group is really bent out of shape, and they say, "What's going on here? There's no justice in this!" Does the second group receive the same salvation? Yes and no. They are brought into a state of salvation; that is, they escape the punishment of hell and enter into the kingdom if indeed that last-breath repentance is genuine. The requirement for entrance into the kingdom of God is to repent and believe in Christ.
The thief on the cross did it in the last minutes of his life, and Jesus assured him that he would be with him in paradise. There we have Exhibit A in the New Testament of somebody who actually did that and who was promised by our Lord himself that he would participate in Jesus' kingdom. Certainly it's possible for a person at the last moment of their life to repent sufficiently, believe, and be justified and enter into all of the benefits of membership of the kingdom of heaven.
However, Paul speaks of those who make it into the kingdom by the skin of their teeth. I think a "deathbed" believer would be in that category. We tend to think that all that matters is getting there because there is an unbridgeable chasm between getting into heaven or missing it altogether. Yet Jesus tells us to work and to store up treasures for ourselves in heaven because he promises emphatically that there will be rewards dispensed to his people according to their obedience and their works. You don't get into heaven by your works, but your reward in heaven will be according to those works, according to the New Testament. What that says to me is that although people can make it by the skin of their teeth by repenting in their last dying breath, nevertheless, their degree of felicity will not be nearly as great as that of those who have been serving Christ faithfully for many, many years.