The number of hours of video that can be recorded is mainly determined by the size of the microSD card installed. The factory sends it with a 4 GB card, but you can easily replace this with a 64 GB card.
Another factor that will affect the recording ability is how much data you choose to "save" on the card. The more pictures or videos that you manually save (as well as video automatically saved during a collision) will reduce the amount of storage available for the looping recording.
If you have manually saved pictures or videos, transfer them to a computer. AFTER you have done that, reformat the SD card, which will erase everything currently stored on it.
If you want a lower quality recording, you can also reduce the resolution and FPS setting, which should allow longer videos to be recorded.