1 Collect the needed resources
To advance from one age to another you need to collect the required amount of resources. The amount of resources needed varies from one civilization to another but it's always a combination of food plus gold.
2 Build the required buildings
The option to upgrade to another age will be dimmed until you build the required buildings. You will have to make sure you built enough buildings in the previous age before you can move to the next one.
3 Upgrades are made from the town hall
All age upgrades are made by clicking on the town hall then clicking the upgrade icon to the next age.
4 Advancing to the Feudal age
To advance to Feudal age you need to build any two dark age buildings, in addition to having 500 food (for most civilizations). The buildings could be any two dark age buildings like a mill, a barracks or a dock. (See How to Give Allies Resources – Age of Empires 2)
5 Advancing to Castle age
Advancing to Castle age requires building two Feudal age buildings such as an Archery Range or Blacksmith, in addition to 800 food and 200 gold.
6 Advancing to imperial age
To advance to imperial age you need to build two Castle age buildings such as a university or siege workshop, in addition to having the required gold and food (1000 food and 800 gold for most civilizations). (See How to counter goths – Age of empires 2)
7 Ending age must be properly set
In case you are playing a standard game then make sure that the ending age is properly set to Imperial before you start the game, else you won't be able to advance until Imperial age.
8 You can't advance in some scenarios
In some Scenarios the option to move to other ages might be locked or the ability to upgrade might be limited to a certain age. If the upgrading icon in the town center is dimmed then the upgrade is possible but you just need to build the missing buildings.