ok prepare for spoilers though
once you get to the mushroom kingdom you enter the castle and talk to toadette. she will unlock achievements. the achievements will now show up in the moon list. to get the moon you need to do what it says to do to complete the achievement.
there are 61 achievements (moons) to collect they have you doing practically everything to collect them to get them all you have to complete all the mini games, quests and get most of the gear from the shop. 3 of these require you to purchase souvenirs these are the things you buy with purple coins. the highest one requires you to buy 40 souvenirs.
also don't leave it too late to get the moons from toadette you have to get ONE moon at a time from her. that means clicking and waiting again...and again...and again.....
oh and if you think your done after getting all the moons and achievements YOUR NOT. to get to 999 moons prepare for possibly the longest part of getting 100% afterwards...
to get the rest of the moons you need to buy them. you can get them at any store and can get up to 10 at a time for 1000 coins. and you will need to buy A LOT so you WILL be grinding for coins. best spot is in the woodland kingdom near the lookout. don't do this until last because you can cheat your way to 999 moons but if you do that you won't be able to do something else