Johannes' comment was correct. You simply need a mask to hide the text outside the rounded rectangle.
I'm merely using your posted gif as a base. The actual Photoshop document will most likely be set up differently, but this is the basic item you need.
Highlight all but the bottom layer in the Layers Panel and group those layers (Layer > Group Layers).
Create a selection which matches the rounded rectangle. Then with the Group highlighted in the Layers Panel, and the selection active, click the little mask icon at the bottom of the Layers Panel. This will add a mask to the group.
This will then hide the text outside the rectangle. (I've increased the animation speed considerably so it can be seen better.)
When setting up the animation, I assume you have only one layer for the scrolling text and are moving it and then creating a motion tween between frames. When you do that, you want to unlink the layer and the mask by clicking the little chain icon between them. This will allow you to move the text, while leaving the mask in a stationary position.