There's an interesting passage towards the end of the Gospel of John, after Jesus's resurrection:
21 Peter seeing him saith to Jesus, Lord, and what shall this man do?
22 Jesus saith unto him, If I will that he tarry till I come, what is
that to thee? follow thou me.
23 Then went this saying abroad among the brethren, that that disciple
should not die: yet Jesus said not unto him, He shall not die; but, If
I will that he tarry till I come, what is that to thee?
Here, John seems to be saying "no comment" on a certain rumor that had gone around in the church, leaving it deliberately ambiguous. The Book of Mormon actually gives an authoritative answer to the question, and this is where the LDS belief comes from.
From 3 Nephi 28:
1 And it came to pass when Jesus had said these words, he spake unto
his disciples, one by one, saying unto them: What is it that ye desire
of me, after that I am gone to the Father?
2 And they all spake, save it were three, saying: We desire that
after we have lived unto the age of man, that our ministry, wherein
thou hast called us, may have an end, that we may speedily come unto
thee in thy kingdom.
3 And he said unto them: Blessed are ye because ye desired this thing
of me; therefore, after that ye are seventy and two years old ye shall
come unto me in my kingdom; and with me ye shall find rest.
4 And when he had spoken unto them, he turned himself unto the three,
and said unto them: What will ye that I should do unto you, when I am
gone unto the Father?
5 And they sorrowed in their hearts, for they durst not speak unto
him the thing which they desired.
6 And he said unto them: Behold, I know your thoughts, and ye have
desired the thing which John, my beloved, who was with me in my
ministry, before that I was lifted up by the Jews, desired of me.
7 Therefore, more blessed are ye, for ye shall never taste of death;
but ye shall live to behold all the doings of the Father unto the
children of men, even until all things shall be fulfilled according to
the will of the Father, when I shall come in my glory with the powers
8 And ye shall never endure the pains of death; but when I shall come
in my glory ye shall be changed in the twinkling of an eye from
mortality to immortality; and then shall ye be blessed in the kingdom
of my Father.