I imagine the process to be like this :
End of level, update stars value in the array for that level
On map screen load, update all level images based on array data
Another way to do it is to just use variables and use 'save' game to save the state of the game. You wouldn't need a global variable for each level, probably one track to track the current level and the stars obtained then when you return to the map you update the relevant level. Problem with this is that it is not permanently stored anywhere and it's hard to track if bugs occur, but you can give the level objects 'persist' behaviour so their variables remain the same.