By RAW, a long rest lasts "at least 8 hours" so it can last more than 8 hours.

It must contain at least 6 hours of sleep
It must contain less than 2 hours of light activity
It must contain less than 1 hour of strenuous activity


What if you start a long rest when you're already at full HP, full Spell Slots, etc?

> You "start" your long rest at full HP, Spell Slots, and other resources.
> You sleep 8 hours but choose not to "finish" your long rest, continuing to stand watch and do light activity for an hour.
> You start traveling down the road for half an hour.
> You get involved in a huge, dangerous battle, still "during" your long rest, but after the long rest could end, and use up all your Spell Slots and lose quite a bit of HP.
> Then you spend a turn sitting on the floor, engaging in "light activity" and declare that you have now "finished" your long rest.
> It is now the "end" of your long rest, you regain all your HP and Spell Slots.
> Now you have a battle in which you are able to use two full days of Spell Slots and other resources??

I mean, I have never heard of a DM who would allow that, but it's funny to think about.