Short answer: the game itself never ends — but the score does have a ceiling.
Endless by design
There's no finish line. The desert scrolls forever and the game keeps accelerating, so a run only ends when you finally hit an obstacle. That's the entire point of an endless runner.
The score ceiling
The score counter is widely reported to cap at 99,999, after which it rolls back to zero. Because the speed keeps rising, reaching that number by hand is effectively impossible — more on the limits in our world-record breakdown.
So the real "ending" is simply your best run. Go set one on the home page, and aim for the milestone in how to reach 9999.