I would suggest that you first make a global variable that remembers what is the highest level number unlocked so far. When the player reaches the end of level 1, do a condition check if the current level is the same as the highest level number unlocked, and if it is, increase that number by one, and return to the level selection layout.
On the level selection layout, exactly how you to this would depend on what visual style you prefer, but let's assume you want to show screenshots of all the levels in the game, and for those that you've unlocked you can click the screenshot to go to that level.
Create a sprite object called "LevelSelect" or something, and add the screenshots from the game to the different animation frames of that object. Add an instance variable to the object, called "level" or something, and make as many instances of this object as you have levels. Change the animation frames to give all the levels the correct screenshot, and in each of the sprites, set the level variable to a different level number.
In the level select screen's event sheet, you now need to add two things to make this work:
- Condition: LevelSelect > Compare instance variable > level less or equal to HighestLevelUnlocked
- Action: Go to layout (by name) > "Level " & LevelSelect.level
That makes all the links to levels clickable - the second step is to make all the locked levels LOOK unlocked. I think you can do that using For Each on the LevelSelect object: On start of layout, check if the level instance variable is greater than HighestLevelUnlocked, and if it is, make LevelSelect spawn another object: A big lock, a semi-transparent black square the same size as the screenshot, or whatever you want to use to make the screenshot look locked.
Or something like that. Haven't tested this, so it may not be bug-free.