Peter was not the only apostle to be put in jail. And some of the apostles were even jailed multiple times.
For example, in Acts 4, Peter and John were taken into custody for teaching that Jesus was the Messiah. After being questioned, they were let go and told not to talk about Jesus anymore.
In Acts 5, the apostles kept preaching about Jesus and were all seized and jailed. During the night, an angel of the Lord released them from jail and told them to continue their preaching, which they did.
In Acts 16, Paul and Silas were put in jail when they were preaching in Philippi. At midnight, there was a great earthquake, and the prison doors flew open and the chains on the prisoners were loosened. Even though they could escape, Paul and Silas stayed to evangelize the jail guard and his family, who were all baptized. In the morning, the authorities set the men free.
Paul was arrested many more times after this. One time, he was kept in jail for several years. As a matter of fact, the letters he wrote to encourage some of the new Christian communities were written while he was in jail. These letters Ephesians, Philippians, Colossians and Philemon -- are part of the New Testament.