The median duration of recorded eruptions is seven weeks, according to Oregon State University; however, they can go on for thousands of years. The Hawaiian volcano Kilauea is an example of a long-lasting eruption. It has been erupting continuously since 1983.
According to Penn State, volcanoes erupt until the melt inside the magma chamber is depleted or the gas pressure eases up to a point where it is no longer seeking escape routes. Since melt is produced continuously inside volcanoes, they can continue erupting as long as gas pressure persists. Long-lasting eruptions can wreak havoc on local ecosystems and human civilization.