It seems likely that the first epistle to Timothy was written after Paul's first imprisonment in Rome was over. The second epistle was during a second imprisonment. Acts only mentions the first imprisonment, but we can be fairly confident there was a second. Acts ends with Paul in custody but confidently preaching the gospel. Paul told Philemon to prepare a room for him, as if he soon expected to be released (Philemon 1:22). In contrast, Paul writes the second epistle to Timothy expecting to die in the near future (2 Timothy 4:6; 2 Timothy 4:9; 2 Timothy 4:21).
The first epistle was written to Timothy in Ephesus, where Paul had placed him to work with the church (1 Timothy 1:3) The second letter may also have been addressed to the same city since both 2 Timothy 1:15; 2 Timothy 1:18 hint at that location. A careful reading of both letters will cause one to feel that Paul was closely guiding the labor of this young preacher as he worked to build up the church.
Circumstances had changed by the time Paul wrote the second letter to Timothy. As he wrote, he was being held as a prisoner and soon expected to die. It appears that he was in Rome during the time of Nero's severe persecution of the church. Thus, the letter would have been written between 64 and 68 A.D. Timothy appears to have been working in Ephesus
when this letter was sent. Paul wrote in hopes that Timothy would be able to join him. However, it is obvious Paul also wrote with the idea of encouraging Timothy to carry on in spite of the terrible persecution the church was enduring, and would endure. If Timothy did not reach Paul before he died, this letter surely must have encouraged him.
Bibliography
Barclay, William. The Letters to Timothy, Titus and Philemon. Philadelphia: The Westminster Press, 1960.
Coffman, James Burton. Commentary on I & II Thessalonians, I & II Timothy, Titus and Philemon. Austin: Firm Foundation Publishing House, 1978.
Guthrie, Donald. The Pastoral Epistles. Grand Rapids: William B. Eerdmans Publishing Company, 1957.
Lipscomb, David. A Commentary on the New Testament Epistles, Volume V. J. W. Shepherd, editor. Nashville: Gospel Advocate Company, 1942.
Roberts, J. W. Letters to Timothy. Austin: Sweet Publishing Company, 1964.
Roberts, J. W. Letters to Titus, Philemon, and the Epistle of James. Austin: Sweet Publishing Company, 1962.
Spain, Carl. The Letters of Paul to Timothy and Titus. Austin: Sweet Publishing Company, 1970.
Stewart, Bruce. A Call to Faith: An Exegetical Commentary on 1 & 2 Timothy and Titus. Mobile: Southeastern Press, Inc., 1996.
Vine, W. E. An Expository Dictionary of New Testament Words. Old Tappan, New Jersey: Fleming H. Revell Company, 1940.