This question often shows up each round. It is basically up to you and what your goals are for the round.
If you are going to stick with the same building, then the most popular answer that has been given by players is when a building has lost 5% - 8% efficiency. If you look at it in days then 25 days or more. Of course this should be after you have completed both upgrades to your factory or shop. Note: Offices don't have any upgrades.
If you are a trends follower or even if you just want to improve things, you can just rebuild as you see fit to other factories or shops. In that case, you probably will not have to worry about percentages or days.
Keep in mind that you will have a loss of production or sales time while the rebuilding is being done. Try not to rebuild too many buildings at one time, spread them out if you can.
Often you see player who believe that rebuilding is not worth this loss, but if you think about it, your staff are now half a round or little less more productive as their stats have improved. Once you apply the two upgrades you will/could see higher production/sales numbers than you did before the rebuilding.
If your still not clear, try rebuilding a couple buildings, see for yourself after a week or so which buildings are more productive. The ones that have been rebuilt or those that were not.
Staffing Hint: Always keep your best staff in the most recently built buildings as you will have your upgrades show up much faster and production numbers will be greater.