Ask your GM
The spell states:
When a creature enters the affected area for the first time on a turn or starts its turn there, the creature must succeed on a Dexterity saving throw or take 3d6 bludgeoning damage and be restrained by the tentacles until the spell ends. A creature that starts its turn in the area and is already restrained by the tentacles takes 3d6 bludgeoning damage.
A creature restrained by the tentacles can use its action to make a Strength or Dexterity check (its choice) against your spell save DC. On a success, it frees itself.
The last bit explains one way to for the restrained condition to end, another is that the spell ends. The other bolded section requires that the creature be restrained and start its turn in the area. This would be redundant unless only one of these requirements could apply, however, this could happen if a creature were immune to the restrained condition, and not only by a creature being outside the area. Additionally, the spell never explicitly states that leaving the area ends the condition; these both, to some small extent, point toward the condition not ending when leaving the area.
The following question already exists:
It results from a similar problem where the hunger of Hadar spell never actually says the condition ends when leaving the area. A well-received answer there states:
But we can give more context here—our familiarity and expectations of the game. One of those is that things shouldn’t be “seriously overpowered,” as we just determined hunger of Hadar is, as written. It seems likely that the authors and editors of hunger of Hadar forgot that conditions basically default to permanent, or missed its implications, and considered their wording as “obviously” meaning the condition only applies as long as creatures are within. It seems they almost-certainly meant that the creatures are blinded for a duration equal to however long they stay fully within the area of hunger of Hadar, or that (partially) leaving the area of hunger of Hadarcounters the blindness. That would make for a reasonable spell. That is how the majority of people, it seems, assume the spell works, because they assume the spell isn’t “seriously overpowered” and read it within that context without checking the actual technical definitions.
Though there isn't the same sort of overpowered end-state (the condition will always end after the spell's duration) we can apply some similar ideas. Mistakes happen in writing and this is a similar case where a condition would logically end upon leaving the area; after all, you are no longer in range of the tentacles.
It also makes sense that the Devs might forget this as you wouldn't expect a restrained creature to move. And so it seems quite reasonable (and intuitive) that the effect is supposed to end upon leaving the area.
There are ways to support either interpretation and so the result is that you'll have to ask your GM.