The timeline can only reflect what's in a clip. It cannot extend "beyond the file." Of course a clip can be shortened ... or lengthened, as with the speed effect.
To eliminate unwanted space between clips, expand the timeline by either dragging the slider (left-bottom of window) to the right or,
in some versions, clicking the two-sided arrow at the far-left bottom of the window. That will show the entire region.
Click on a clip adjacent to the black frames and drag it left/right to butt to the desired clip. It should snap into place.
Or, if this is a gap, with no video in it, just right-click the gap and CLOSE GAP.
Experiment with both methods to see what works best in your case. Remember, if you make a mistake, immediately press <ctrl-Z> to undo it.