If you are inside a function, in this case:
stringstream myStream(s);
myStream is allocated on the stack. It will be destroyed automatically at the end of the scope. It is also very efficient.
In this case:
stringstream *myStream = new stringstream(s);
myStream is a pointer to an object allocated on the heap. It will be destroyed when you call delete myStream
.
Most of the time you want to use the stack. It is efficient and the memory gets freed automatically for you. It also just happens to be less to type.
Sometimes you need more control. You want a function to create an object and have it exist until you explicitly delete it. These cases should be rare, and with modern C++ you should use something like unique_ptr or shared_ptr to make managing the memory easier.