For instance, if the world was created when version 1.7
was out and then 1.8
was released.
Questions
So, is there any way to upgrade a local minecraft world?
Or does this happen automatically?
Minecrafts worlds are backwards compatible.
You will not have any problems. Minecraft will automatically upgrade them.
I played very very long with an Alpha world, very long. Never had any problems besides that I have no biomes, no pumpkins or anything else that was added later.
Please consider that the worlds are backwards compatible but only partly upwards compatible. This means that your game will crash if you load a game with new biomes, blocks or items inside of an old version which doesn't know about these items.
You can safely upgrade your Minecraft. Your Savegames will stay compatible. You can create backups if you are really worried but I never had problems with Mojangs Algorithm.
Have a nice day
In support of the previous answer, if you load a world that has a higher version of minecraft into a lower version client any blocks that were not available in the older version are automatically converted to air blocks (which in some cases can make things very difficult and even unstable).
In the case of world generation, converting your world to an older version can corrupt, crash or simply not load at worst case. I have ran into all of these. I have loaded 1.7 worlds into 1.4 version without problems, and other times the game would just crash.
Loading an older map into a new version of the game the only issue that is notable when the game converts it is if the newer version uses a different world generation algorithm the game will do 'odd' things between chunks that were previously loaded and chunks newly loaded in the new version. However chunks that have already been generated/explored in previous version will not generate blocks that were added in the later version. For example, if you load a 1.7 map into 1.8, chunks that you had already generated won't have any andesite, granite, diorite just to name a few things.
Great advice is to ALWAYS backup files before attempting as there is never a guarantee that nothing wrong can happen, anybody tell you otherwise is mistaken.
A lot of what determines what will happen is determined what what changes are made between version. Some features will actually load in previously loaded chunks for example, the dungeons, villages, nether fortresses, water temples. This is because what causes them to generate is not stored as part of the world data but rather as separate files.
There are also versions that you should never ever downgrade to as they will certainly crash and corrupt your world (I will have to look up which version, but Mojang released patch updates for them soon after to fix the problem. It can also be found in their change logs)
Finally, not all version will detect world saves from all versions. Older versions stored world save files differently, so loading up these version they will not see newer versions, however I believe newer versions of the game can find those files still.
A bit of flavor: The April 1st 2015 update will NOT load any other maps, however any world created with it are accessible (renamed) in later versions of the game. And the villagers lost the control over the universe they gained in April 1st 2014 on April 2nd and the world was right again....except, they stare at you as if you know, you know, they know you know.