Not automatically. A work permit and a residence permit are two separate documents. Cancelling the work permit does not by itself cancel the residence permit; the residence permit still needs to be handled separately, otherwise you can be left in an irregular stay.
Nationwide (all cities)
Two separate documents
This is one of the most common misunderstandings. A work permit and a work-type residence permit are two separate documents, and cancelling one does not automatically cancel the other.
Connected but separate steps
The regulations describe them as connected but distinct steps. Under the Regulations on Employment of Foreigners in China, when your employment contract is terminated, the employer must report it to the labour and public security authorities and return your employment permit and residence permit, and then go through the exit formalities. In other words, the residence permit is handled as its own separate step, not as something that expires on its own when the work permit is cancelled.
Why doing nothing is risky
So if you cancel the work permit but do nothing about the residence permit, you are not automatically legal. The residence permit still shows a period of stay, and you need to decide: transfer it to a new employer, or wind it down as part of leaving. Leaving it unresolved can leave you in an irregular stay once the underlying employment has ended.