Basically the world gets devided into chunks, and get loaded and unloaded depending on the distance to the player (in the background). When the player enters a area that isn't loaded completly yet a loading screen is displayed.
In the case of single player games, such as the "The Elder Scrolls"-Series, the chunks are divided after distance from the player, things in near chunks are calculated in-detail, frequently, the more far away the chunks are the less frequent and the less detailed the calculations become to save processing power. The things in far away land might even only ever updated when the player approaches them, the player won't notice anyway.
Another thing is LOD (Level of Detail), each chunk of the landscape mesh is saved multiple times in different detail levels, for chunks far away only the lowest detail level is kept in memory, for chunks near the highest detail level is used.
For procedurally generated landscapes, like those found in the Diablo games, when loading a chunk it is checked if this chunk was already generated, if yes it is just loaded from the hard disk, if not a new chunk is generated which is then saved on disk.
In the case of MMORPGs, such as World of Warcraft, the whole world is calculated and saved on the servers... the invidual clients wouldn't be able to do so. If the server isn't powerful enough alone then the chunks are distributed between multiple servers. The distance can't be used here because the players are everywhere, all chunks need the complete power.