Make numbers in table of contents go to right of page in Pages
Show the ruler (View → Show Rulers), then adjust the TOC as you desire, such as:

Move the page numbers by selecting all TOC levels (hold ⌘ while clicking to select multiple levels) and moving the marker on the ruler.



Indent headings based on hierarchy by selecting sub levels and moving the marker on the ruler.



Add dots between heading and page number using the inspector: Text → Tabs: Leader.