A few of your initial statements are not quite correct:
For the char * and char [] example, in both cases the variable itself, str remains in scope and accessible until the program ends if it's declared in the global namespace.
If it's declared in a function or a method's scope, it's accessible while the scope remains active. Both of them.
As far as what actually happens to the memory that's used to store the actual literal strings, that's unspecified. A particular C++ implementation is free to manage runtime memory in whatever manner is more convenient for it, as long as the results are compliant with the C++ standard. As far as C++ goes, you are not accessing the memory used by the str object, you're only referencing the str object itself.
Of course, you are free to take a native char * pointer, pointing to one of the character in the str. But whether or not the pointer is valid is tied directly to the scope of the underlying object. When the corresponding str object goes out of scope, the pointer is no longer valid, and accessing the contents of the pointer becomes undefined behavior.
Note that in the case where str is in the global namespace, the scope of str is the lifetime of the program, so the point is moot. But when str is in a local scope, and it goes out of scope, using the pointer becomes undefined behavior. What happens to the underlying memory is irrelevant. The C++ standard doesn't really define much what should or should not happen to memory in the underlying implementation, but what is or is not undefined behavior.
Based on that, you can pretty much figure out the answer for the std::string case yourself. It's the same thing. You are accessing the std::string object, and not the underlying memory, and the same principle applies.
But note that in addition to the scoping issue, some, but not all, methods of the std::string object are also specified as invalidating all existing direct pointers, and iterators, to its contents, so this also affects whether or not a direct char * to one of the characters in the std::string remains valid.
staticstorage duration, so it always lives for the entire lifetime of the program.std::basic_stringdoes not own the literal, so its lifetime is not determined bystr's.