It's called an accidental - even though it's there on purpose! An accidental in a bar will affect the note it's just before, and any other same place notes following in the same bar. Once the bar line is reached, that accidental ceases to have impact. If it's needed later, it needs re-instating, only to be cancelled by the following bar line. Uncannily, it won't affect any notes of the same name which are an octave or two away, only the note/s it precedes.
If it needs cancelling (e.g. Eb with accidental followed by Enat.) then the second E will have a natural sign before it.
All this is regardless of the key sig., and usually the result of a particular note not being included diatonically (in the key), in the manner that a 'changed' note, like an Enat in key Bb will need to be shown with an accidental.