The time needed to raze a building is half of the time it takes for a Citizen to construct the building. For example, Farms take a single Citizen 10 seconds (150 frames) to build, and 5 seconds (75 frames) to raze. Once you have Science 6, the time to raze is only 90% of this time. With Science 7, the time is 80% of the normal raze time.
A city can only be razed if no civilian buildings are within the city's economic radius. Only one building at a time can be razed within a city's borders. Your capital cannot be razed. Cities themselves take 4X as long to raze, thus taking 80 seconds (1200 frames) instead of 20 seconds (300 frames) to be razed, while they take 40 seconds (600 frames) to build. The Senate takes 16X as long to raze, to prevent quickly razing it and building another Senate elsewhere when the capital comes under attack. A city being assimilated takes 125 seconds (1875 frames) to raze.
When a building is razed, you receive the plunder value back as resources. Since the plunder value is not necessarily the same as the resources used to construct the building, it allows for a slow (and fairly inefficient) means of converting resources. For example, farms take Timber to build but gives Food as plunder, so it's possible to convert Timber to Food in this way. It is inefficient, however.
While a building is being razed, its max hit points decreases, in proportion to the raze progress. The current hit points will also decrease by this amount. If the current hit points drops to 0, then any hit on the building can destroy it. If the raze is cancelled, the original hit points are restored immediately (minus any damage the building took in the meantime).
If you capture a city but are unlikely to be able to hold it, you should raze the buildings nearby to make it more expensive for the enemy to rebuild the city. Production buildings such as farms should be razed first because they are razed quickly (due to their fast build time). Other worthwhile buildings include the University, Temple, and Market.