
Dragon Ball

An easy way to explain Roshi's immortality is that he used the Dragon Balls to wish for eternal life. This might not be surprising, as characters like Vegeta, Frieza, and Piccolo have sought the Dragon Balls for similar reasons, some even successfully. However, it seems unlikely, as Roshi didn't know about the Dragon Balls before meeting Goku and Bulma. Yet, Master Roshi was willing to exchange one for Bulma just to see her body. Or later, he had the chance to make a wish with the Eternal Dragon but never used them for anything personal.
Heavenly Herb

Another explanation is in a Dragon Ball Super filler episode titled 'Goku and Krillin! Back to the Old Familiar Training Ground!' where he assigned his two disciples a task to find a herb called the 'Heavenly Herb'. According to him, this herb has the ability to extend Roshi's lifespan.
Fountain of Youth Elixir

When Goku and Chichi came to see Master Roshi to borrow the Bansho Fan, he suggested exchanging it for something else from Bulma and said it was his last wish in his final years. At that time, Turtle revealed that Roshi had consumed a dose of the Fountain of Youth Elixir, so how could he die? And this might be one of the reasons why Roshi could live for so long.
In conclusion, the truth about Roshi's longevity remains unanswered. However, if the above is true, then Master Roshi is not immortal, but rather knowledge and power are the factors that grant him extraordinary longevity.