No octopus you get in a home aquarium is going to live more than 2 years at most, and that is if you hatch it and raise it. You need a chiller to prolong the life of most species, otherwise you're looking at more close to 1 year. This given you can provide it with live food unless you are lucky enough that it accepts raw shrimp. Prepare for one that doesn't eat convenient frozen fish food. Unfortunately when you buy an octopus you don't know how old it is unless it is tank bred, and most species are very rarely found tank bred. They have a naturally short lifespan.
Unless you get a dwarf species like Joubini or Mercatoris you need at least a 50 gallon tank. You should have very strong filtration that includes a protein skimmer. You should glue fine mesh over your intakes so it doesn't stick its arms in and lose the tips in a powerhead or get sucked into your filtration.
Bimacs can grow up to over 2 feet spread out and Briareus considerably larger. Joubini's are dwarfs and would be suitable in a 30 gallon, but the nocturnal species aren't much fun in my experience. You need a red light to view them, when they come out at the wee hours of the morning, if they come out at all. Oh, and dwarf octopus only lives 6-8 months.
Don't bother spending a ridiculous amount of money on a Mimic or Wonderpus. They don't display their mimic behavior in captivity, nor do they adapt well to captivity. Not to mention they are rare so keep conservation in mind.
Blue-Rings, as already stated, are deadly and should be left to the most experienced. Really they shouldn't even be imported.