Res permits are valid for thirty days and must be transfered over within that period when you get a new passport.
Z Visa that got you into China = valid for 30 days
Residence Permit that lets you stay = valid for 10-12 months ... and this is the one you have to think about when replacing a passport. It can only be replaced in China and, from memory, it costs about the same as for your original. Not every International Office will pay for a new Res Permit.
There is most probably no set time limit to replace it as you are kind of covered by the old Res Permit and in the 'old days' could most probably negotiate your way out of China using both passports. I am not sure I would want to take the risk these days.
There are other situations when you will need a passport in China - booking into a hotel is one, travelling by train or plane - and I am pretty sure that at some point the 2 passport option is not going to be accepted.