Sounds like you are confusing Layout with Viewport. If you create a new project you see the Layout has dotted lines on the right and bottom. This is the Viewport and what you see when you run. The Layout keeps going. If you want to limit the Layout to be the same as the Viewport, click on the Layout and change the Layout Size to match the Window Size of the project (click on the project itself).