First you have to label which text in the document are headings. You do this by applying a "Headings" style to it. So if they are not already marked, go through the whole doc, and for each paragraph that's the section heading, select a "Headings" from the Styles.
If on Word 2007, the Styles are on the Home tab.
If on Word 2003 or older, the Styles are under the Format menu, but it's quicker to select it from the Styles select box that's next to the font face type select box. If you've never used Styles before or changed them, your Styles box probably has the "Normal" Style selected.
Select "Heading 1" for the first level of heading, and if you have subheadings, select the next level "Heading 2" etc.
Once you've labeled all the headings with the Style type, Word can create a table of contents finding all the Heading styles in your document and automatically indicate the page number where the heading is located.
If on Word 2007, go to the References tab > Table of Contents > Insert Table of Contents.
If on Word 2003 or older, go to the Insert menu > Reference > Index and Tables.
A wizard window appears with different types of Reference configurations.
Go to the Table of Contents tab if it's not already there.
Near the bottom in the "Show Levels" option, select the number of Heading levels you want in the Table of Contents. For example, if you have only "Heading 1" styles in your document, then you only need "1" here.
There are other options here you can choose from. Select what you want.
Then click on the OK button and Word will create your Table of Contents.