When you get a S-, S or S+ on a champion you already reached mastery 5 with you get a mastery token for that champion. Once you get 2 mastery tokens you can exchange those tokens + 500 blue essence (or the champion shard for that champion) to reach mastery 6.
It's similar for reaching mastery 7 but you have to get a S or S+ on a mastery 6 to get it for that (and for mastery 7 you need 600 blue essence)
If you are asking what is the point of getting mastery on a champion...It's nothing but for show. You get the mastery icon on your loading screen (as I'm sure you saw by now) and you can flash your icon over your character in game by pressing ctrl + 6. Mastery 6 and 7 is the same thing, but you get different icons. The background for the icon is purple for mastery 6, and it's blue for mastery 7.