Its not an urban legend, it's been documented before. Plus my friend has a picture of his dead octo in his goldfish tank. And no, he didn't put it there!! ( that's what he told me anyway...)
Well, the length of time it could stay completely out would depend on the environment. It basically has to ensure that it doesn't dry out and can get oxygen. One documentry mentioned "up to 10 minutes" so i'll go by that.