It doesn't automatically stop.So long as
The person being cared for receives a "qualifying benefit", th emain ones are DLA or Attendance Allowance
AND
The person claiming Carer Allowance spends at least 35 hours per week providing "care". Care has an extremely broad definition and includes almost everything (such as doing laundry, shopping, or simply being available if needed, you do not need to live with the caree either)
So there is nothing to say that just because the caree is in residental care you cannot receive Carer's Allowance - so long as the criteria are fulfilled you can
As I recall, the 35 hours has to be throughout a week and regular - so it can't be, say, just a whole weekend but nothing else. It also similarly has to be throughout a month or year so you can't do one whole week of 24/7 care in a month, that sort of thing.
However, all this said, it would probably be quite hard to justify claiming CA if the caree is in full-time residential care, as the authorities could question exactly what you are doing that the care home isn't (and possibly should be)