user6105: To be more exact: Given two blocks A and B, with heights A < B, but with positions in the blk file (we'll call them pA and pB) pA > pB.
What is the maximum amount of blocks that there could be stored in a blk*.dat file, between pB and pA?
For instance, let's say this is a blk*.dat file:
C D B E F G A H I
We can see here that block A is stored 3 blocks later than B, despite A having a lower height than B. Is there a maximum amount for this value (which in this case is 3)?

user2306: 1024.
/** Size of the "block download window": how far ahead of our current height do we fetch?
 *  Larger windows tolerate larger download speed differences between peer, but increase the potential
 *  degree of disordering of blocks on disk (which make reindexing and in the future perhaps pruning
 *  harder). We'll probably want to make this a per-peer adaptive value at some point. */
static const unsigned int BLOCK_DOWNLOAD_WINDOW = 1024;

(Source.)

6105: <p>To be more exact: Given two blocks A and B, with heights A &lt; B, but with positions in the blk file (we'll call them pA and pB) pA > pB.</p>

<p>What is the maximum amount of blocks that there could be stored in a blk*.dat file, between pB and pA?</p>

<p>For instance, let's say this is a blk*.dat file:</p>

<p>C D <strong>B</strong> E F G <strong>A</strong> H I</p>

<p>We can see here that block A is stored 3 blocks later than B, despite A having a lower height than B. Is there a maximum amount for this value (which in this case is 3)?</p>
 2306: <p>1024.</p>

<pre><code>/** Size of the "block download window": how far ahead of our current height do we fetch?
 *  Larger windows tolerate larger download speed differences between peer, but increase the potential
 *  degree of disordering of blocks on disk (which make reindexing and in the future perhaps pruning
 *  harder). We'll probably want to make this a per-peer adaptive value at some point. */
static const unsigned int BLOCK_DOWNLOAD_WINDOW = 1024;
</code></pre>

<p>(<a href="https://github.com/bitcoin/bitcoin/search?utf8=%E2%9C%93&amp;q=BLOCK_DOWNLOAD_WINDOW" rel="nofollow noreferrer">Source.</a>)</p>
