A heading “logically” introduces some explanation or elaboration on a topic. This means it is followed by an “ordinary” paragraph. As such both paragraphs (heading + text) forms a single semantic unit.
They can be kept on the same page when you check the Keep with next paragraph box in the Text Flow
tab of the heading paragraph definition.
This box is checked by default in the Heading n styles.
In case your heading is multi-line, the heading may be split, space permitting, with a few lines at the bottom of the page and the remaining at the top of the next page. If this is undesirable (e.g. for chapter title, while it might be acceptable for sub-chapters), you can force “blocking” the whole paragraph, making it behave as a single line.
In the same Text Flow
tab, check the Do not split paragraph (it is not checked by default in Heading n).
With the combination of both boxes you vary the circumstances under which the heading is pushed to next page.
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!