It will never end humankind needs something to believe after death, thats where religion comes out to tell the people not to worry about it and obey some rules to achieved that promised heaven.
Uniquely how long humanity will exist, there will be a lot of religion. Those who do not believe can not understand, just what a believer believes. Many people are sure there is humility, comfort and all that they need in this life.
I don't need to believe in a superior being that watches me from above to feel humility and comfort. The weaker a person is the more he needs this father figure to guide him through life. I never had such needs.
I think religions will continue to exist, but their influence will be much smaller. The smarter we are, the more childish stories in holy books become to us.