ANSWER: There is no sure answer to this question because the Bible does not give us the exact details of John's death. Information regarding his last days comes to us primarily from tradition.
The 1910 Catholic Encyclopedia states concerning John that writers in the second and third centuries A.D. recognized and accepted a widely held tradition that the apostle spent his last days in Ephesus. According to the Catholics, Justin Martyr also referred to John as one of Jesus apostles who lived in Ephesus. St. Irenaes, Eusebius and still others, again according to the Encyclopedia, all agree that after leaving the isle of Patmos (where John was banished to - see Revelation 1:9) John spent his remaining days in Ephesus until he died somewhere around 100 A.D.
The well-known reference book Foxe's Book of Martyrs says that the apostle John, as punishment for being a believer in Christ, was thrown into a cauldron of boiling oil. The Emperor Domitian then (as if that were not enough) sent John to the island of Patmos (which is near the coast of Asia Minor and the city of Ephesus). It was during his time on the island that John, likely around 95 A.D., wrote the book of Revelation. When Emperor Nerva came to power he released John from his island imprisonment. John seems to have been the only one of Jesus' original twelve apostles who escape a violent death.
Lastly, Easton's Bible Dictionary writes that John 'retired' to Ephesus after writing Revelation. The aged apostle likely, according to Easton's, outlived just about all his friends and his many acquaintances made over the years.
BibleStudy.org's research has lead to the conclusion that John was exiled to Patmos in 95 A.D. It was during his stay on the island that he not only wrote the Book of Revelation but also finished writing his gospel account. After his release, he finalized the arrangement of books and the canonization of the New Testament around 96 - 99 A.D. John, the last living apostle, lived a long life and likely died close to 100 A.D.