In Spanish, we have one type of written accent (called “tilde” in Spanish) and it can appear with any vowel: á, é, í, ó, ú. Here you have the accentuation rules according to the type of word (with a minimum of two syllables):
“Agudas”.- A word is aguda (acute) when the stress is on the last syllable. An acute word will only have a written accent if it ends in a vowel (a, e, i, o, u) or in the consonants n or s. Examples: comió (ate), canción (song), dieciséis (sixteen).
“Graves / llanas”.- A word is grave or llana (grave) when it has the stress on the penultimate syllable. As a general rule, these words always get a written accent EXCEPT when they end in a vowel (a, e, i, o, u) or in the consonants “n”, or “s”. Examples with tilde: árbol (tree), álbum (album); and with no tilde: baile (dance), canciones (songs), comieron (they ate).
An exception to this rule occurs when there is a hiatus, which is the situation when there are 2 adjoining vowels that you pronounce in two different syllables (as opposed to a diphthong where the vowels are pronounced in a single syllable). For this separation to happen the “closed vowel” (“i” or “u”) will have the written accent. Examples: día (day), frío (cold), grúa (wrecker), garúa (drizzle). Normally, according to the general rule, these “grave words” would not have a written accent, since all of them end in vowels. However, they receive the written accent, because there is a hiatus when you pronounce them. Therefore, with the accent, you separate the syllables this way: dí-a; frí-o; grú-a; ga-rú-a.
“Esdrújulas”.- A word is esdrújula when it has the stress on the antepenultimate syllable, and it will ALWAYS have a written accent. Examples: último (last), público (public), política (politics).
“Sobreesdrújulas”.- A word is sobreesdrújula when it had the stress before the antepenultimate syllable, and it will ALWAYS have a written accent. We find examples of this type of words in the verbal forms of the imperative, containing enclitic pronouns, such as: cuéntamelo (tell it to me), cómpraselo (buy it to him).
Finally, monosyllabic words will have a written accent when you need to distinguish them from the same word, but with a different meaning. This is called the “diacritical mark”. Some examples:
Tú tienes tu motivo. You have your reason.
¿Te sirvo más té? Shall I serve you more tea?
Había más dulces, mas ya me los comí todos. There were more candies, but I already ate them all.