Literary Devices defines a cliffhanger as an abrupt ending or revelation that leaves the protagonist in a difficult, unresolved situation. The greatest cliffhanger enthusiast of all, the "Arabian Nights" princess Scheherazade, famously avoided execution by "hooking" a caliph with "to-be-continued" endings to her thousand-odd tales. She understood that the cliffhanger's purpose is to induce the reader to continue while gasping for the cliffhanger's resolution. For this reason, cliffhangers fare best at chapter's endings, since the author wants the reader to keep on with the story. Placement is essential; the next element is timing.
The master of timing cliffhangers was Charles Dickens, who serialized, in "Bentley's Monthly" magazine, most of his novels in 20 chapter installments. If you read Dickens with an eye to the cliffhangers, you'll find they manifest at four- to five-chapter intervals. For example, "Great Expectations" follows the orphan Pip as he befriends the convict Magwitch, stealing food and tools for the outcast. The police arrive at Pip's house at the close of Chapter 4, and Dickens' breathless readers had to wait a month to see whether the young innocent faced jail time.
The Huffington Post further recommends that the cliffhanger be planned and organic to the story rather than a cheap trick. Nothing is so deadening to readers as a sudden new crisis or antagonist introduced for no apparent reason. The character or situation carrying the crisis must be integrated into the tale long before the cliffhanger. A wonderful example is Thomas Hardy's "Mayor of Casterbridge." The protagonist fires a minor character named Jopp in the 10th chapter. Jopp returns with a cliffhanging challenge of blackmail in Chapter 26.
If you examine the examples, you'll find the simple steps to cliffhangers in Hardy, Dickens and the "Arabian Nights" princess. Each invents tales with protagonists in challenging situations. Each adds antagonists early on whose presence or revelations force a difficult choice onto the protagonist. The moments of choice occur at chapter breaks. Groundwork for any plot twists is laid beforehand in earlier foreshadowing events. In other words, cliffhangers are carefully planned; that is their essential secret. It is also the elderly author's secret, just in case you were breathlessly waiting for it.