When creating a new, specify a length that is as long as you want to record.
For unlimited recording, enable the Unbounded recording setting (press the F11 key and choose the Record tab). You must still specify
a long enough length when creating the file if you want to see recording
continue past the right edge of the Sound window.
Use Edit | Select All to select the entire file (or select the area you want to record over) before recording.
Recording always occurs within the selected area and the selection may be updated after recording. If you manually stop or cancel recording, you
may have to adjust the selection again (or undo the recording).
Update your sound card driver. Some defective drivers are unstable and stop recording for no reason.