You'll need to download GameSparks addon, register your game on their website etc. Search the forum for more information.
GameSparks is just one option, there are many other services you can use (for example, Firebase), or store leaderboards on your own server.