He uses the structure of a Shakespearean sonnet (with the rhyme scheme abab cdcd efef gg), and he also starts each quatrain with "when" (or "and when" for the third), which enforces that division (I've added line breaks to further emphasize it):
When I have fears that I may cease to be
Before my pen has glean'd my teeming brain,
Before high piled books, in charact'ry
Hold like rich garners the full-ripened grain;
When I behold, upon the night's starred face,
Huge cloudy symbols of a high romance,
And think that I may never live to trace
Their shadows with the magic hand of chance;
And when I feel, fair creature of an hour!
That I shall never look upon thee more,
Never have relish in the fairy power
Of unreflecting love! - then on the shore
Of the wide world I stand alone, and think,[In referencing this sonnet in two different anthologies, I've discovered that the punctuation doesn't match, so your experience may vary.]
Till love and fame to nothingness do sink.
Between the rhyme scheme and that leading "when" (plus the semi-colons), Keats makes that structure fairly obvious, but then he doesn't follow through with it. There's a break in the twelfth line: "Of unreflecting love! - then on the shore." In a way, that third quatrain has a premature end, and the last couplet begins early. In college, I even made a note of this: the "then" completes the idea that's started with the various "when"s. When [this], [this], and [this], then [this].
But the thing that I realized when I read the poem recently is that not holding to the structure there mirrors what the speaker is saying. There's the interruption in life that the speaker mentioned (that is, death), and that "then" coming in half a line too soon is an interruption in the sonnet structure.