When I mark a note with an accidental, is that accidental gonna be applied to that note for its duration or is it applied every time that same note is played in that same measure?
The accidental will apply to following notes in the same measure / bar but not after that. If it is needed to cancel the effect before then another accidental (maybe a natural sign) will be required.
Oddly, although a sharp or flat in the key signature affects the same note in other octaves, an accidental does not.
An extra point thanks to Arthur. In the case of a tie across bar lines, it also lasts for the remainder of that tie (but not to the rest of the second bar).
And thanks to Guy G, note that odd exceptions may occur. Some older manuscripts may expect that the accidental applies to other octaves.