The story begins in the 1940s. In 1947 Thomas T. Goldsmith Jr. and Estle Ray Mann filed a US patent for a "cathode ray tube amusement device," an ancestor rather than a game as we would recognise one. Gaming reached the mainstream in the 1970s and 1980s, when arcades, home consoles and personal computers arrived together.
Since then it has become one of the dominant forms of entertainment worldwide. Multiple console generations have come and gone, and the industry now spans everything from mobile puzzle games to persistent online worlds.
The 1990s brought the decisive shift. Competing proprietary platforms matured, and the internet created an entirely new category in the MMORPG, where thousands of players share a single evolving world. Both strands — the tightly controlled multiplayer match and the sprawling online world — are now standard, served through services like Xbox Live, PlayStation Network and Nintendo's own online infrastructure.
For a fuller account of any particular era, the histories published by the major games press go into considerably more detail.