The Good Wife has not had anything close to good ratings when it comes to the demo (total viewers are good) since it's early days but I assume it does something Boston Legal did for ABC and appeal to high income viewers or something CBS other shows don't do and of course the critical reception helps + CBS owned show right?
For CBS owned shows which have a minimum of 88+ episodes and already have off-network syndication deals, ratings don't appear to matter as much.
As to when such shows will be canceled, I strongly suspect will be dependent on the non-public details of the syndication deals and the costs of creating new episodes/seasons.