The different colors are showing how "good" you finished the level. 

- You get a golden flag if you jump to the very top of the flagpole at the end of the level
- Green star above the flag means that you have all green stars collected in that level (3 stars every level)
- Red flag means Mario was first to the pole, pink mean Princess Peach got there first, green is Luigi, blue is Toad and light blue for Rosalina