We can easily setup Table of Contents in Google Documents. Please make use of the following steps for your reference:
1. For all the Titles, use Format –> Paragraph styles –> Heading 1 or your choice of selection. This steps should be done for all the Titles to be included in the Table of Contents.
Note:
Please avoid using this step 1 for other text contents in your Google Documents.

2. Use Insert –> Table of contents to insert the Table of Contents in your Google Documents. The Table of Contents will make use of all the titles used in the Step 1.
