There are at least a couple of ways to solve this. The gray area directly above the timeline is called the Work Area Bar. It normally covers the entire project, but you can drag the handles at each end to select only a particular part of your project to output. Sometimes during the normal editing process the WAB can end up extending past the end of your project, which is apparently what happened to you. First, zoom out so that the entire project, including all of the WAB, is visible. If you double-click in the WAB you should see it resize automatically to fit your project. If for some reason this doesn't work (which does happen in certain circumstances) you can also just click and drag the handle at the right end of the WAB back to the end of your project.
Edit: Peru makes a good point. Accidentally leaving a few frames out at the end by themselves will make the WAB think your project extends much farther than you intended. Look for and delete any stray frames (zoom in close to see them) and then resize the WAB as necessary.
WAB.JPG
You do not have the required permissions to view the files attached to this post.