The maximum number of such boxes is 6. One example is shown in the figure.

Now we show that 6 is the maximum. Suppose that boxes B1,…,Bn satisfy the condition. Let the closed intervals Ik and Jk be the projections of Bk onto the x- and y-axis, for 1≤k≤n.
If Bi and Bj intersect, with a common point (x,y), then x∈Ii∩Ij and y∈Ji∩Jj. So the intersections Ii∩Ij and Ji∩Jj are nonempty. Conversely, if x∈Ii∩Ij and y∈Ji∩Jj for some real numbers x,y, then (x,y) is a common point of Bi and Bj. Putting it around, Bi and Bj are disjoint if and only if their projections on at least one coordinate axis are disjoint.
For brevity we call two boxes or intervals adjacent if their indices differ by 1 modulo n, and nonadjacent otherwise.
The adjacent boxes Bk and Bk+1 do not intersect for each k=1,…,n. Hence (Ik,Ik+1) or (Jk,Jk+1) is a pair of disjoint intervals, 1≤k≤n. So there are at least n pairs of disjoint intervals among (I1,I2),…,(In−1,In),(In,I1);(J1,J2),…,(Jn−1,Jn),(Jn,J1).
Next, every two nonadjacent boxes intersect, hence their projections on both axes intersect, too. Then the claim below shows that at most 3 pairs among (I1,I2),…,(In−1,In),(In,I1) are disjoint, and the same holds for (J1,J2),…,(Jn−1,Jn),(Jn,J1). Consequently n≤3+3=6, as stated. Thus we are left with the claim and its justification.
Claim. Let Δ1,Δ2,…,Δn be intervals on a straight line such that every two nonadjacent intervals intersect. Then Δk and Δk+1 are disjoint for at most three values of k=1,…,n.
Proof. Denote Δk=[ak,bk],1≤k≤n. Let α=max(a1,…,an) be the rightmost among the left endpoints of Δ1,…,Δn, and let β=min(b1,…,bn) be the leftmost among their right endpoints. Assume that α=a2 without loss of generality.
If α≤β then ai≤α≤β≤bi for all i. Every Δi contains α, and thus no disjoint pair (Δi,Δi+1) exists.
If β<α then β=bi for some i such that ai<bi=β<α=a2<b2, hence Δ2 and Δi are disjoint. Now Δ2 intersects all remaining intervals except possibly Δ1 and Δ3, so Δ2 and Δi can be disjoint only if i=1 or i=3. Suppose by symmetry that i=3; then β=b3. Since each of the intervals Δ4,…,Δn intersects Δ2, we have ai≤α≤bi for i=4,…,n. Therefore α∈Δ4∩…∩Δn, in particular Δ4∩…∩Δn=∅. Similarly, Δ5,…,Δn,Δ1 all intersect Δ3, so that Δ5∩…∩Δn∩Δ1=∅ as β∈Δ5∩…∩Δn∩Δ1. This leaves (Δ1,Δ2), (Δ2,Δ3) and (Δ3,Δ4) as the only candidates for disjoint interval pairs, as desired.