A flat (or sharp) in the key signature applies to that note name in EVERY octave. The previous answer stating otherwise was incorrect.
Key Sig: ♭ on middle line (B) Octave 4: ♭ on line 3 → B♭4 Octave 5: ♭ on space 4 → B♭5 (ledger line) Octave 3: ♭ on space 2 → B♭3
All affected by the single flat in the key signature.
Some think "key signature only affects staff lines shown"—but it's pitch-class based. Every B on the instrument is flatted unless canceled.
Memory aid: "Key signature = global default for that note name."