Welcome to TONMO, the premier cephalopod interest community, and birthplace of #WorldOctopusDay and #CephalopodAwarenessDays. Founded in 2000, we are a large community of experts, hobbyists and enthusiasts, some of whom come together when we host our biennial conference. To join in on the fun, sign up. You can also become a Supporter for just $50/year to remove all ads and enjoy other perks. Follow us on Twitter for more cephy goodness.
There's been some research that shows that if part of an octopus' brain is removed, it delays its reaching sexual maturity, and it lives a bit longer. However, I wouldn't really recommend doing brain surgery on your pet.
I seem to remember that removing the testis or ovary doesn't change the lifespan any, just makes the animal unable to reproduce when it does mature. I think in O. Vulgaris removing the optic gland increases the lifespan a bit, but it's taking one piece out of a complicated system. It's also worth noting that this work was done in fairly large octopuses by experts, and it's not clear how many octos even survived the brain surgery... I'd guess that removing parts of the brain of the bimacs and other small octos people keep as pets would be even harder and more likely to harm the animal.