Accent marks are used in Spanish to show that a particular letter in a word should be pronounced harder or louder than the other letters. This is particularly important when two words are spelt the same. In these case one usually takes an accent mark.
Accent marks are always used with vowels.
Orthographic rules can be used to tell when to use accent marks.