Life span depends on species, temperature, amount of food and sexual activity just to name a few factors. You can't generalize for all octpus. Some cold and/or deepwater species live for several years; some pygmy species less than a year. Unless you obtain a juvenile, something like O. mercatoris or O. bocki will be with you only 2 to 4 months. When I get adult blue-rings, I usually expect them to live two or three months at most.
Roy