The moon area can only be accessed after completing all four temples: Woodland, Snowhead, Great Bay, and Stone Tower. After midnight on the final day, use the deku flower in Central Clock Town to reach the top of the clock tower. At the top, play the 'Oath to Order.' This will trigger a cutscene that takes you to the moon.