You need to click on the building you would like to upgrade and choose the "Details" option. In the next screen you will be able to choose to either normally upgrade or instantly upgrade. While normal upgrading costs resources and time, the instant option will cost gold. When the upgrade has reached a certain time limit, you will get the "Instant Finish" option. The time frame when this will be possible can be changed through an activated VIP level. The overall construction time can be influenced by researches and buffs.