Up to 24 weeks. Someone was recently jailed for self inducing an abortion near term. If we want to get technical, abortion is decriminalised in that it's an offence to do it unless it's done medically and two doctors need to sign off that it's necessary for the physical or mental health of the patient.
Though abortion is legal in the UK, there are TRAP laws in place requiring certain conditions to be met first, paramount of which is that two separate doctors need to agree that the patient meets the criteria of the 1967 Abortion Act before any treatment can go ahead. Self-managed abortion is a criminal offense with a maximum sentence of life imprisonment in the UK, as is any abortion performed after the pregnancy has progressed passed 23 weeks and six days, unless the patient is at risk of serious physical harm or death, or the fetus has severe developmental anomalies.