Warhammer 40,000 has crammed the intervening 38,000 years between now and its dark future with history and incident, while also giving ancient alien civilizations like the necrons, c'tan, and old ones stories that spread back into prehistory. We'll be skipping past that stuff here for the sake of sanity, but even so there's a lot of ground to cover and things will have to be summarized. While the 41st millennium is worth breaking down into individual years, what precedes is lumped together into broad ages. Which isn't to say that stuff doesn't matter—the 31st millennium gave us the Horus Heresy, an event that set up much of what happens after and spawned an entire line of over 50 novels.
It's a lot, is the general point here. And it's a confused lot too. Dates are given according to the Imperial system, which is a problem because the vast interstellar bureaucracy of the Imperium of Man contains an entire division called the Ordo Chronos who are supposed to set official dates, but are currently experiencing a civil war called the Chronostrife. Their task is basically impossible because the Great Rift—a tear in reality established near the end of the 41st millennium—has caused temporal shifts and fluctuations.
These are all very good reasons for Games Workshop to change their minds about specific dates and times given in various sources, and any look back through the older books is fraught with uncertainty. But we do what we can, and here's how the history of Warhammer 40,000 looks today.
Age of Terra, M1 — M15
In this age humans slowly begin understanding the universe beyond Terra, eventually terraforming Mars and from there other nearby worlds.
The Dark Age of Technology, M15 — M25
Warpspace is discovered around M18, enabling the invention of warpdrives and FTL interstellar travel. This expansion leads to the first encounters with xenos.
Age of Strife, M25 — M30
Warp storms separate and isolate human colonies, and wars break out both between them. Various xenos species take advantage of this separation to invade.
The Great Crusade, M30
The Emperor becomes leader of Terra, creates the Primarchs and Space Marine legions, and sends them to unite the scattered human worlds into an Imperium. Mars is the first to rejoin the fold, and its Adeptus Mechanicus provide the technology that drives the crusade.
The Horus Heresy, M31
Horus, Warmaster of the Great Crusade, betrays the Emperor. The legions are divided, and many side with Horus. His forces are eventually defeated when they lay siege to the Imperial Palace on Terra, but the Emperor is wounded has to be encased in life support within the Golden Throne to keep him alive. The traitor legions are driven to the Eye of Terror in the Great Scourging, from which they emerge periodically in actions called Black Crusades.\
(The videogames Betrayal at Calth, Battle of Tallarn, The Horus Heresy: Legions, and Talisman: The Horus Heresy are all set in this period. So is the tabletop game Adeptus Titanicus, and presumably the forthcoming campaign of its videogame adaptation will be too.)
The Rise of the Ecclesiarchy, M32
While the Emperor maintained an Imperial Truth that held there were no gods and used the Great Crusade to spread this message, during the Horus Heresy many within the Imperium began to worship him as God-Emperor. With his encasement in the Golden Throne this movement gains power and becomes the official religion of the Imperium.
The Nova Terra Interregnum, M34 — M35
The Imperium is split in half by another civil war, this time caused by Nova Terra and the entire Segmentum Pacificum seceding. For nine centuries there are two warring Imperiums of Mankind.
The Age of Apostasy, M36
A conflict between the Ecclesiarch and the other High Lords of Terra called the Reign of Blood is followed by a Plague of Unbelief in which an apostate cardinal challenges the church itself.
The Age of Redemption, M37 — M41
Multiple crusades of faith burn out the apostates and heretics at the heart of the Imperial Cult and renew the faith of the Imperium.
The 41st Millennium, M41
Abaddon the Despoiler leads the 12th Black Crusade, opening with a raid on Arx Station. This is the first battle in what becomes the Gothic War.
(Battlefleet Gothic Armada is set during this conflict.)
Eldar come to the aid of the Imperial forces in the Gothic War. The combined force is victorious, though they spend several more years pursuing the fleeing Chaos forces all the way back to the Eye of Terror.
Inquisitor Gregor Eisenhorn's six-year hunt for the heretic Murdin Eyclone comes to a head on the planet Hubris, within the cryonic vaults where the frozen planet's wealthy citizens sleep through its winter.
(These are the events of Eisenhorn—Xenos, both the game and the novel it's based on.)
War between the Deffsmasha orks and Imperial forces in the Garmos system drags on as dark eldar launch well-timed raids on both sides to maintain the balance of power.
Lord Commander Solar Macharius leads a seven-year crusade that brings almost 1,000 worlds into the Imperium, many of them former colonies lost in the Age of Apostasy.
Macharius dies and becomes an Imperial Saint. The generals who fought for him squabble over the territories they control, beginning a civil war called the Macharian Heresy.
Chaos Marines of the World Eaters legion attack the Imperial world of Armageddon, and are defeated by the Space Wolves and Grey Knights chapters.
A space hulk called the Sin of Damnation emerges from the warp. Previously, in 996.M40, Marines of the Blood Angels had attempted to assault it and failed disastrously. They return and this time successfully recapture it.
(These events are the basis for Space Hulk, Space Hulk: Vengeance of the Blood Angels and one of the campaigns in Space Hulk: Ascension.)
In the Koath system a probe is found that, when translated, bears a message of greeting from a xenos species called the tau.
The Ultramarines lead a united force in the Corinthian Crusade, defeating the orks of Charadon.
A new chapter of Marines called the Mentor Legion is created as part of the 26th Founding.
The Inquisition investigates trade between tau and the Imperium in the Damocles Gulf, declares the xenos to be a threat, and begins the Damocles Crusade against them.
Szarekh, Silent King of the ancient cybernetic beings called necrons, learns that creatures from beyond the galaxy are approaching. The tyranids are a conglomeration of species ruled by a hive mind who incorporate each world they conquer into their biomass. Szarekh begins awakening the necrons on their Tomb Worlds to fight the tyranids.
The First Tyrannic War takes place as the Imperium fights back against the invading tyranids, whose spread is halted by the Ultramarines at the Battle for Macragge. The Inquisition investigates and determines this invasion force, named Hive Fleet Behemoth, is only the first.
A tyranid hive fleet dubbed Naga enters the galaxy in eldar space, and is eventually destroyed by them at great cost.
The hive world Piety emerges from a warpstorm overrun by Chaos. Sisters of Battle descend to recover several holy artifacts, but only a handful survive. The planet is eventually destroyed by Grey Knights via Exterminatus.
The first contact between the Imperium and necrons occurs at a Sisters of Battle fortress-convent called Sanctuary 101, which the necrons destroy completely.
The Chapter Master of the Astral Claws Space Marines rebels, destroys an Imperial fleet sent to investigate while they are in orbit around their homeworld Badab, and declares himself the Tyrant of Badab.
The Tau Empire is beset by Hive Fleet Gorgon. The tau are forced to ally with the Imperium to stop them.
The Second War for Armageddon. A huge force of orks led by Ghazghkull Mag Uruk Thraka attacks the hive world Armageddon, but are held back by Imperial Guard under the command of Commissar Yarrick long enough for Space Marines to arrive and drive them off.
(These are the events of Warhammer 40,000: Armageddon and Warhammer 40,000: Armageddon—Da Orks.)
The tau fight a gigantic ork invasion fleet in the Great War of Confederation.
The orks of Charadon are united under Arch-Arsonist Snagrod and rampage through the Loki Sector. At Rynn's World they defeat the Marines of the Crimson Fists, but reinforcements from the Dark Angels chapter arrive and purge them from Loki Sector.
Hive Fleet Kraken is destroyed in the Second Tyrannic War, but not before devastating the eldar craftworld of Iyanden and two chapters of Space Marines—the Scythes of the Emperor and the Lamenters.
The Third War for Armageddon. Troops from over 20 Space Marine chapters are required to hold Ghazghkull Thraka's orks this time, dragging the battle out until the warlord grows bored and departs.
Following a warp anomaly called the Great Awakening, which triggers multiple daemon invasions, Abaddon launches the 13th Black Crusade. The planet Cadia is destroyed. Roboute Guilliman, Primarch of the Ultramarines, is awakened after 10,000 years in stasis and becomes Lord Commander of the Imperium's armies.
(Battlefleet Gothic: Armada 2 is set during this conflict. Dawn of War happens in the same year, although that's according to a novelization which is probably not canon.)
Roboute Guilliman, having defeated the 13th Black Crusade, launches the Indomitus Crusade to reunite the Imperium it tore in half. With a new and improved generation of Space Marines called the Primaris under his command, he dedicates the first century of the 42nd millennium to this crusade.