Domitian became emperor in 81 AD, and the Christian persecution lasted from 95-96 AD. The persecution ended when he was assassinated in 96 AD (Introduction, pg. 2).
So, I assume John was imprisoned in 95 or 96 AD.
“The persecutions under Nero and Domitian were not undertaken by the state as such; they were simply personal matters, and established no precedent as to the conduct of the state toward Christianity. They were rather spasmodic outbursts of personal enmity, but were looked upon with great horror as the first to which the Church was subjected. … Domitian’s cruelty and ferocity were extreme, and many persons of the highest rank fell under his condemnation and suffered banishment and even death, not especially on account of Christianity, though there were Christians among them, but on account of his jealousy, and for political reasons of various sorts. That Domitian’s persecution of the Christians was not of long duration is testified by Tertullian, Apol. 5.”
Arthur Cushman McGiffert, Eusebius’ History (Nicene and Post-Nicene Fathers, Series II, Vol. 1), fn. 1 to Bk. 3, Ch. 17, “The Persecution Under Domitian,” p. 147.
“Tertullian has also mentioned Domitian in the following words: ‘Domitian also, who possessed a share of Nero’s cruelty, attempted once to do the same thing that the latter did. But because he had, I suppose, some intelligence, he very soon ceased, and even recalled those whom he had banished.’ But after Domitian had reigned fifteen years, and Nerva had succeeded to the empire, the Roman Senate, according to the writers that record the history of those days, voted that Domitian’s honors should be cancelled, and that those who had been unjustly banished should return to their homes and have their property restored to them. It was at this time that the apostle John returned from his banishment in the island and took up his abode at Ephesus, according to an ancient Christian tradition.”
Eusebius, The History, Bk. 3. Ch. 20, “The Relatives of our Saviour,” pp. 151-152.
“A conspiracy among his own freedmen—set on foot, it is said, by his wife Domitia Longina, who knew her own life to be threatened—cut short his career. He was stabbed in his bedroom by a freedman of Clemens named Stephanus on the 18th of September 96.”
“Domitian,” The Encyclopaedia Britannica, Vol. 12, p. 405. They fix the dates of his reign from AD 81-96.