When I try to do a voice over using the record button for a mic, the voice over track only last a few seconds then just cuts off. how do I get the recording to last for the length of the video I am trying to do a voice over with,
The most obvious one to check would be your range markers.
Make sure they are set for the complete length of the project.
If it is not that then we really need your full computer specs put into your signature as requested in a previous post by @johnbaker to save the 'twenty questions' routine to get to the bottom of the problem.
Further to what Ray mentioned, there are two modes available for recording - Play while recording - off/on. If you have Play while recording checked (on) and a range set, recording will stop after the duration of the range is reached. If Play while recording is not checked and a range is set, there is no limit to recording duration, but you won't see anything happening on the timeline.
If there is nothing on the timeline, you can't turn on Play while record. If you have material on the timeline, recording will stop at the end of the material but it doesn't turn off by itself. Stop recording and you'll see that your recording will be cut off at the end of the material.