It is easier to answer the complementary question about spacing before TOC because a TOC always has a heading formatted with paragraph style Contents Heading. You just modify spacing for this style.
A TOC may end with any style Contents n with n = 1 to 10. You can’t do the spacing trick on these styles otherwise you mess up your whole TOC.
I wonder about the relevance of your question, document structure-wise. A TOC is usually isolated from other parts of the documents. In a common structure, you have a cover, maybe a dedication, the TOC, the chapters and optionally an index. All these parts are separated from each other by a page break.
For instance, you may add a page break in the Text Flow
tab of paragraph style Heading 1 to automatically start your chapter on a new page. This effectively creates a huge “spacing” between the TOC and the first chapter. So, I don’t see your purpose in having some text after the TOC, unless it is some addition or comment for the TOC itself.
In this case, you can change the settings in Indents & spacing
tab of the first paragraph after the TOC. This is direct formatting and is therefore not recommended. A better solution (for the same effect) is to define a custom paragraph style (name it First after TOC or similar) with adequate spacing specification and make it automatically followed by the paragraph style used for the rest of this part of the document (or Text Body which is the default style for the discourse).
To show the community your question has been answered, click the ✓ next to the correct answer, and “upvote” by clicking on the ^ arrow of any helpful answers. These are the mechanisms for communicating the quality of the Q&A on this site. Thanks!
In case you need clarification, edit your question (not an answer) or comment the relevant answer.