Not quite. A long rest is a period of at least 8 hours during which the characters sleep for at least 6 hours, engage in light activity for up to 2 hours, and engage in other activity for no more than 1 hour. There are different ways you can configure your time engaging in these various types of activities, but they have to total 8 hours, not exceed 1 hour of total of adventuring and 2 hours total of light activity, and must include at least 6 hours of sleeping.
So, can the party declare that they’re starting a long rest and then just continue adventuring? Sure, but if they are still adventuring over an hour later, if they don’t sleep for at least 6 of the next 8 hours, or if they spend more than 2 of the next 8 hours doing non-adventuring, non-sleeping activity, they won’t be able to finish the rest and gain it’s benefits.