Pokemon's timeline is somewhat confusing because Game Freak genuinely doesn't care enough about it to keep it consistent. However, there has been enough evidence and canon dialogue lines in the lore to piece it all together.
Pokemon Red, Blue, Yellow, Ruby, Sapphire, and Emerald, and all subsequent remakes all take place in 1996 (same year gen 1 was released in Japan.)
Pokemon Gold, Silver, Crystal, Diamond, Pearl, and Platinum, and all remakes, take place in 1999 (same year gen 2 was released in Japan.)
Pokemon Black, White, Black 2, and White 2 take place twelve years after gen 4, with certain characters like Caitlin (of the Gen 4 Battle Frontier and Gen 5 Elite Four) aging up from 14 to 26, Cynthia going from 20 to 32, and Looker aging up from 28 to 40. There's also the "Russian" former Team Rocket member who now lives in Icirrus City and has an 11 year old son and a wife now, which he (likely) didn't have back in Team Rocket in Kanto. This would set gen 5 in 2011, which was the present-day when Black and White had their international releases, which was March 2011. Pretty much since gen 5, every mainline game has been set in the present.
Pokemon Black and White 2 are two years later in 2013, and set during the same time as X & Y, which are also in 2013.
Pokemon Sun, Moon, Ultra Sun, and Ultra Moon is confirmed to be twenty years after the events of gen 1 and trainers Red and Blue are 31 years old in those games, as well as it being the "twenty-first anniversary of Porygon's discovery" (which was in 1995, in the lore), which means gen 7 takes place in 2016, three years after B2 & W2 and X & Y, which was also the present-day when the games were released.
There's also four different timelines. The years don't change, but the specific sequence of events in the timelines do change.
Gen 1 and 2 is the "Classic" Timeline and stops at gen 2, and it's implied in ORAS' Delta Episode that this timeline's world was destroyed by a giant asteroid colliding into Earth in late 1999. Trainer Red looks Japanese in this timeline.
Gens 3 through 5 take place in the "Advanced" Timeline and stops at gen 5, but includes the events from gen 1 and 2 via the remakes. Trainer Red looks American in this timeline (to set him apart further from Ash and to look separate.)
The "Mega" Timeline is gen 6 and 7 and includes all Mega Evolutions, where as they never existed in the continuity before X & Y. They also include the events of gens 1 through 5, but mostly only shown through specials like Pokemon Origins and Pokemon Evolutions, rather than further remakes. Trainer Red looks Japanese again, but is also a grown adult here in his thirties.
The most current one is the "Switch" Timeline, which is gen 8 to present, and starts at Sword and Shield and is implied to have had similar events to the first 7 generations which slight changes, like Chase or Elaine becoming the legends of Kanto, instead of Red. Trainer Red is back to looking Japanese again like his gen 1 counterpart here.
There's also a completely separate Let's Go Pikachu and Eevee timeline where wild battles don't take place (excluding legendaries), and Held Items and Abilities don't exist, if you consider those games to be canon, although they're really not canon and no one really cares about them.
So when you chart it all out, nice and neat, the Pokemon Timeline looks like this:
GENERATION |
TIMELINE |
GAMES |
YEAR(S) |
Gen 1 |
Classic Timeline (Game Boy) |
Pokemon Red, (Japanese) Green, Blue, & Yellow |
1996 |
Gen 2 |
Classic Timeline (Game Boy Color) |
Pokemon Gold, Silver, & Crystal |
1999 |
GENERATION |
TIMELINE |
GAMES |
YEAR(S) |
Gen 3 |
Advanced Timeline (GBA) |
Pokemon Ruby, Sapphire, & Emerald |
1996 |
Gen 3 |
Advanced Timeline (GBA) |
Pokemon FireRed, LeafGreen, & AquaBlue |
1996 |
Gen 3.5 |
Advanced Timeline (GameCube) |
Pokemon Colosseum |
1997 |
Gen 3.5 |
Advanced Timeline (GameCube) |
Pokemon Gale of Darkness |
1999 |
Gen 4 |
Advanced Timeline (DS) |
Pokemon Diamond, Pearl, & Platinum |
1999 |
Gen 4 |
Advanced Timeline (DS) |
Pokemon HeartGold, SoulSilver, & MindCrystal |
1999 |
Gen 5 |
Advanced Timeline (DS) |
Pokemon Black & White |
2011 |
Gen 5 |
Advanced Timeline (DS) |
Pokemon Black 2 & White 2 |
2013 |
GENERATION |
TIMELINE |
GAMES |
YEAR(S) |
Gen 6 |
Mega Timeline A (Anime) |
Pokemon Origins (Gen 1 retelling) |
1996 |
Gen 6 |
Mega Timeline A (3DS) |
Pokemon Omega Ruby, Alpha Sapphire, & Delta Emerald |
1996 |
Gen 6 |
Mega Timeline B (Anime) |
Pokemon Generations (Gens 1-6 retelling) |
1996-2013 |
Gen 6 |
Mega Timeline A (3DS) |
Pokemon X & Y |
2013 |
Gen 6 |
Mega Timeline B (3DS) |
Pokemon Z |
2013 |
Gen 7 |
Mega Timeline A (3DS) |
Pokemon Sun & Moon |
2016 |
Gen 7 |
Mega Timeline B (3DS) |
Pokemon Ultra Sun & Ultra Moon |
2016 |
*The events of gen 2, gen 4, and gen 5 are never shown in Mega Timeline A, but are assumed to be similar or the same to the ones we know.
GENERATION |
TIMELINE |
GAMES |
YEAR(S) |
Gen 7.5 |
Go Timeline (Switch) |
Pokemon Let's Go Pikachu & Eevee |
1996 |
GENERATION |
TIMELINE |
GAMES |
YEAR(S) |
Gen 8 |
Switch Timeline (Switch) |
Pokemon Arceus |
1700 |
Gen 8 |
Switch Timeline (Switch) |
Pokemon Brilliant Diamond & Shining Pearl |
1999 |
Gen 8 |
Switch Timeline (Anime) |
Pokemon Evolutions (Gens 1-8 retelling) |
1996-2019 |
Gen 8 |
Switch Timeline (Switch) |
Pokemon Sword & Shield |
2019 |
Gen 9 |
Switch Timeline (Switch) |
Pokemon Scarlet & Violet |
2022 |
there doesn't seem to be anything here