Psch...,
Nice thread. I started one on a similar vein some years ago.
The religionists are not qualified to answer so we can ignore all their posts. People who cannot distinguish between fantasy and reality aren't likely to offer any intelligible answers on this issue, as we can see above.
So when will religion end?
All the time the human race exhibits a vast array of creative imaginative and speculative ideas and with a tendency to confuse such potentials as real then religion in some form will likely always exist. It represents an inherent irrational aspect of the human psyche. It is the downside to one of our greatest strengths, the ability to imagine.
But religions (the major ones anyway) today rest on several fundamental observations.
1. Death appears inevitable and represents the prospect of non-existence which many find distasteful and unacceptable. This single fact is the root basis of every major religion and nearly all the lesser ones, i.e. the concept that somehow death is survivable in some type of mysterious ethereal form.
2. Man appears to be the pinnacle of life on the planet and must be the result of some form of intent.
If one or both of these conditions change in any fundamental manner then the effect on the credibility of religion would be eroded, and the degree would be dependent on the extent of the change.
If solutions are found to stop and/or reverse the aging process then death ceases to become inevitable. Without death being a commonplace event and with the real prospect of open ended life spans then the concept of life after death loses, probably significantly, any relevance. Without the life after death concept pretty much every religion will lose the affect of its primary promise.
The development of AI and machines with intelligence equal and likely greater than man, and with appropriate emotional and self–aware capabilities will also significantly erode the illusion that man is somehow perfect or a pinnacle of some supernatural achievement.
The discovery of alien life, potentially of a very different form to us will also erode the perception that somehow man is special.
And finally, a very long view, and probably an unlikely scenario since I suspect AI will replace mankind, but there is the outside chance that man could simply continue to evolve into something superior. This might well be the result of genetic engineering where we deliberately design in strengths and eliminate weakness. Very much along the same lines where man took the wolf and from that base bred all the vast array of different dogs we see today. But with man, intelligence and creativity would likely be the dominant design features. The result would likely be a human far beyond what we know as human today. The conclusion is that we would have designed our own destiny and the concept of a supernatural cause would just seem a silly idea.
Religions will slowly die, although smoldering embers might continue for a long time.