If your visa is issued on the basis of your relationship with your partner you must tell UK Visas and Immigration, the government body that manages visa applications, if you separate or get divorced.
You must then apply for a visa in your own right or leave the UK.
This applies if your former partner is a British Citizen, a Citizen of a European Economic Area country, a ‘settled person’ living in the UK with Indefinite Leave to Remain or someone with refugee or humanitarian protection.