Most probably the angel came to release them from prison in the early hours of the morning. The temple courts was an appropriate place for the apostles to go since it was frequented by lots of people and also the place where God had historically chosen to make himself known to the people of Israel.1 In the early hours of the morning, Jews would also be gathering for prayers2 and bringing the morning sacrifice.3
21 And when they heard this, they entered the temple at daybreak and began to teach.Now when the high priest came, and those who were with him, they called together the council, all the senate of the people of Israel, and sent to the prison to have them brought.