As long as we are living we must repent & show works worthy of it:
Ezekiel 33:10-20
King James Version (KJV)
10 Therefore, O thou son of man, speak unto the house of Israel; Thus ye speak, saying, If our transgressions and our sins be upon us, and we pine away in them, how should we then live?
11 Say unto them, As I live, saith the Lord God, I have no pleasure in the death of the wicked; but that the wicked turn from his way and live: turn ye, turn ye from your evil ways; for why will ye die, O house of Israel?
12 Therefore, thou son of man, say unto the children of thy people, The righteousness of the righteous shall not deliver him in the day of his transgression: as for the wickedness of the wicked, he shall not fall thereby in the day that he turneth from his wickedness; neither shall the righteous be able to live for his righteousness in the day that he sinneth.
13 When I shall say to the righteous, that he shall surely live; if he trust to his own righteousness, and commit iniquity, all his righteousnesses shall not be remembered; but for his iniquity that he hath committed, he shall die for it.
14 Again, when I say unto the wicked, Thou shalt surely die; if he turn from his sin, and do that which is lawful and right;
15 If the wicked restore the pledge, give again that he had robbed, walk in the statutes of life, without committing iniquity; he shall surely live, he shall not die.
16 None of his sins that he hath committed shall be mentioned unto him: he hath done that which is lawful and right; he shall surely live.
17 Yet the children of thy people say, The way of the Lord is not equal: but as for them, their way is not equal.
18 When the righteous turneth from his righteousness, and committeth iniquity, he shall even die thereby.
19 But if the wicked turn from his wickedness, and do that which is lawful and right, he shall live thereby.
20 Yet ye say, The way of the Lord is not equal. O ye house of Israel, I will judge you every one after his ways.
Acts 26:17-20
King James Version (KJV)
17 Delivering thee from the people, and from the Gentiles, unto whom now I send thee,
18 To open their eyes, and to turn them from darkness to light, and from the power of Satan unto God, that they may receive forgiveness of sins, and inheritance among them which are sanctified by faith that is in me.
19 Whereupon, O king Agrippa, I was not disobedient unto the heavenly vision:
20 But shewed first unto them of Damascus, and at Jerusalem, and throughout all the coasts of Judaea, and then to the Gentiles, that they should repent and turn to God, and do works meet for repentance.
We can be forgiven to the moment of our death:
Luke 23:39-43
King James Version (KJV)
39 And one of the malefactors which were hanged railed on him, saying, If thou be Christ, save thyself and us.
40 But the other answering rebuked him, saying, Dost not thou fear God, seeing thou art in the same condemnation?
41 And we indeed justly; for we receive the due reward of our deeds: but this man hath done nothing amiss.
42 And he said unto Jesus, Lord, remember me when thou comest into thy kingdom.
43 And Jesus said unto him, Verily I say unto thee, Today shalt thou be with me in paradise.