Matthew 10:22
22 And ye shall be hated of all men for my name's sake: but he that endureth to the end shall be saved.
Matthew 24:13
13 But he that shall endure unto the end, the same shall be saved.
Mark 13:13
13 And ye shall be hated of all men for my name's sake: but he that shall endure unto the end, the same shall be saved.
These verses are very commonly used to teach that unless a Christian "endures to the end" of their lives in faith and an unspecified level of good works, they will not be "saved" from Hell.
Let's analyze whether that's a valid interpretation.
The passages in Matthew 24 and Mark 13 are parallel passages, and they both have the context of Jesus preaching about the "Great Tribulation" (Matthew 24:21, Mark 13:19).
Immediately preceding both passages, Christ details how believers in the end times will be hated, persecuted, betrayed by their families, and delivered up to be put to death:
Matthew 24:9-12
9 Then shall they deliver you up to be afflicted, and shall kill you: and ye shall be hated of all nations for my name's sake.
10 And then shall many be offended, and shall betray one another, and shall hate one another.
11 And many false prophets shall rise, and shall deceive many.
12 And because iniquity shall abound, the love of many shall wax cold.
Mark 13:9-12
9 But take heed to yourselves: for they shall deliver you up to councils; and in the synagogues ye shall be beaten: and ye shall be brought before rulers and kings for my sake, for a testimony against them.
10 And the gospel must first be published among all nations.
11 But when they shall lead you, and deliver you up, take no thought beforehand what ye shall speak, neither do ye premeditate: but whatsoever shall be given you in that hour, that speak ye: for it is not ye that speak, but the Holy Ghost.
12 Now the brother shall betray the brother to death, and the father the son; and children shall rise up against their parents, and shall cause them to be put to death.
Christ then goes on explain that the Great Tribulation will be supernaturally cut short, otherwise no "flesh should be saved":
Matthew 24:21-22
21 For then shall be great tribulation, such as was not since the beginning of the world to this time, no, nor ever shall be.
22 And except those days should be shortened, there should no flesh be saved: but for the elect's sake those days shall be shortened.
Mark 13:19-20
19 For in those days shall be affliction, such as was not from the beginning of the creation which God created unto this time, neither shall be.
20 And except that the Lord had shortened those days, no flesh should be saved: but for the elect's sake, whom he hath chosen, he hath shortened the days.
He continues on to teach that He will take whatever believers remain on the planet at that time away to be with Him (Matthew 24:29-31, Mark 13:26-27), an event commonly called "The Rapture", which is also described in 1 Thessalonians 4:13-17.
Therefore in Matthew 24:13 and Mark 13:13, "enduring to the end" refers to the end of the Great Tribulation, and being "saved" refers to having one's life saved from death at the hand of the Antichrist, via the Rapture. Eternal Salvation from Hell is totally foreign to the context. It's not even close to being a correct or reasonable interpretation of these passages.
Matthew 10:22 also deals with the same themes, though it is preached at a different time in Christ's ministry.
In Matthew chapter 10, we see much the same progression of Jesus warning us to "beware of men" (Matthew 10:17), because they will persecute you, your own family will betray you, and you will be delivered up to be put to death (Matthew 10:17-21). Matthew 10:22 is therefore also speaking about salvation from physical death at the hands of men via the Rapture, not Salvation from Hell.
In summary, these passages do not teach that "enduring to the end to be saved" means being a good person until you die so that you can go to Heaven. That interpretation requires these passages to be totally isolated from their context.
They speak to the Great Tribulation, the Post-Tribulation, Pre-Wrath Rapture, and physical salvation from death at the hands of other human beings.