It states in the Gemora (Sanhedrin 97a):
Rav Ketina says: Six thousand years is the duration of the world, and it is in ruins for one thousand years. The duration of the period during which the world is in ruins is derived from a verse, as it is stated: “And the Lord alone shall be exalted on that day” (Isaiah 2:11), and the day of God lasts one thousand years. Abaye says: It is in ruins for two thousand years, as it is stated: “After two days He will revive us; in the third day He will revive us, and we shall live in His presence” (Hosea 6:2).
It seems like the year 6000 is the end of the world and the end of potential yimot HaMashiach. But my Rabbis teached me, that the year 6000 is the Last year in which the Mashiach is suposed to come for sure, if he does not come earlier, and the years 6000-7000 are the messianic era.
Can anyone explain ?