Interiors count as one cell each. So if you're in a dungeon, that's all one cell. However some dungeons are split into multiple cells. So for example if you find a door in a dungeon that says "Magic Dungeon Catacombs" or whatever, and going through that door pops up a loading screen, then that's a different cell.
Outside, the world is split up into cells based on a grid. Type tb on the console to see where the cell borders are. Cells are loaded into memory as the player walks around, based on the uGridsToLoad value (default 5). That means that as you wander, a radius of 5x5 cells are loaded around you. As you cross the first border of the last cell in the radius, the game will unload previous cells and re-load the 5x5 radius.
Oh, and cities are in their own wordspaces. They keep the same cell idea as outside, but the cells aren't loaded if you approach it in the wilderness. You must go through a load door. Then, within the city, 5x5 cells are loaded around you as normal, except that exterior wilderness cells aren't loaded (the opposite of what happened outside).
So, walking into a tavern and waiting however long will trigger a reaspawn to outside. However running to the bottom of Whiterun won't trigger a respawn because you've still got the cell from the top of Whiterun loaded in memory.