Locally...its pretty easy. Online...you are asking for lots more effort.
Locally...Its just about creating a file that stores the list, loading that in, and modifying it. You can store the list in arrays, or a different data structure if you choose. Then its a simple comparison of the current score with the ones in the list, and asking for a name, etc... and resaving the file when the scores change.
Online...You will need a server to store the information, on top of local storage(for if the scores are good enough for the list but the PC is offline currently). You will then need code to make a connection to that server, download the list, and upload a score if it is worthy(last part could be handled on the server instead of the client). Despite this paragraph not being very big, when you actually take a look at the thing, there are many more complications involved.