1st You'll need a bunch of variables here, or a vector. I'll explain how to use the variables, you can check out array tutorials later on if you want to learn to use the tools construct2 offer you.
2nd You can easily figure this out by yourself by studing the construct2 manual and reading tutorials. It's a good thing to understand about construct2 before trying to create your algorithms.
3rd here we go.
You will need a variable to keep track of the maximum amount of stars the player acquired each level, StarLevel1, Starlevel2, StarLevel3 and so on. Or you can create a single array to save all of them but whatever.
You will also need a variable to keep track of the amount of stars, or score that the player manage to reach in that specific level. Lets call it "CurrentScore" for now.
So what you want to do is, every time the player finishes a level, you save his new score at the "CurrentScore" Variable, and then AFTER that, you go and check if the value at the "CurrentScore" is bigger or lesser than the value on the "StarLevelX" that keeps track of the max score, and do the changes accordingly .
The code sheet would go something like this:
add action > system > set value :
Variable : Stars
Value : currentScore > stars? Currentscore : Stars