The 9th chapter of Daniel takes place in the year 3390, the year of the great Pekidah of Koresh, where all Jews were invited back to the land of Israel. See Ezra chapter 1. The majority of the chapter is a prayer for the rebuilding of Yerushalayim. Verses 21-27 describe what happened to Daniel as he finished his prayer.
Gavriel appears to Daniel and explains to him that 490 years have been decreed. The term used of Shavua is explained as meaning cycles of 7 years. This expression is used in the Mishnah to refer to which year of the shmitah cycle. See Masechet Shvi'it 4:7 for one such example.
Summary/Explanation (Summarized according to some of the commentators):
24. Seventy Weeks have been decreed upon Israel and Yerushalayim. This period starts with the beginning of the atonement of the sins of Israel and Yerushalayim: 3338. It lasted 490 years (70 * 7 years) until 3828 with the destruction of the 2nd Beit HaMikdash. This tells us from the beginning that the existence of the 2nd Beit HaMikdash was in a way a Chesed from above, not bestowed due to merit. The period is made up of 70 years of Galut Bavel, and 420 years of the 2nd Beit HaMikdash.
During these 70 Weeks:
- Am Yisrael's sin was to be atoned for.
- A Beit HaMikdash was to be built.
- Prophecy was to cease
25. From the time of the going out of the word to return and build Yerushalayim until the anointed leader is 7 Weeks. The is the time from the destruction (and the prophecy about the rebuilding) until the decree of Koresh to rebuild Yerushalayim. From the time of the destruction in 3338 to the decree of Koresh is 52 years, which is 7 Weeks and 3 years. Only the full weeks are counted. For 62 Weeks, the city will be built and settled, however it will be a time of trouble. 62 weeks * 7 years = 434. 3390 + 434 = 3824, 4 years before the destruction of the 2nd Beit HaMikdash.
So to summarize, there are 3 periods: 70 weeks, and then its division to 7 weeks and 62 weeks. The missing week is the years on top of the 7 weeks and the 62 weeks.
In other words, it is 7 Weeks and 3 years, 62 Weeks and 4 years.
There is an important message to be gleaned from the decree of 70 Weeks: It is possible for Am Yisrael to be granted the Beit HaMikdash in spite of a lack of merit. We should not expect any different in our day. When the 3rd Beit HaMikdash is built, we will have a tremendous opportunity to do Teshuvah, and indeed its building is a great act of Teshuvah by itself. However the building of the Beit HaMikdash is not indicative of our arrival at the Final Goal.