Stress and written accent / Los acentos

Every word has a stressed syllable (sílaba tónica). For example, the word español stresses the last syllable.

Word endings and written accents (tildes) provide a predictable guide to stress syllables in Spanish, allowing you to read any word correctly.

 A. BASIC RULES FOR THE USAGE OF ACCENTS / REGLAS BÁSICAS DE ACENTUACIÓN

1. Words that end in a vowel, -n, or -s stress the next-to-last syllable: clase, examen, mesas.

2. Words that do not end in a vowel, -n, or -s, stress the last syllable: bondad, papel, cantar.

Words that do not follow the above rules carry a written accent to show which syllable is stressed:
ca (does not follow rule 1: it ends in a vowel but stresses the last syllable)
emenes (neither the last nor the next-to-last syllable is stressed)
árbol (does not follow rule 2: it does not end in a vowel, -n or -s, but still stresses the next-to-last syllable)

According to the basic rules, thus, you need two criteria to decide whether a word needs a tilde or not:a) its ending,b) which syllable is stressed.

The word región needs a tilde because
a) it ends with “n” but
b) the penultimate syllable is not stressed.

The word regiones does not need a tilde because
a) it ends with “s” and
b) the penultimate syllable is stressed.

 B. OTHER USES OF THE WRITTEN ACCENT / OTROS USOS DE LA TILDE

3. The written accent also indicates stress on a weak vowel (i, u) that is followed or preceded by a strong vowel (a, e, o): dí·a,  Ma·rí·a,  Ra·úl,  o·í·do,  a·hí,  ra·íz,  mí·o,  dú·o,  ge·o·gra·fí·a
BUT: democracia (the weak vowel “i” is not stressed, therefore rule 1 applies)

4. A written accent is not used for one-syllable words (fe, ti, tres, Dios), except to distinguish between certain words that are otherwise spelled identically, such as:

give (command)
he/him
more
me
I know
yes
tea
you
dé
él
más
mí
sé
sí
té
tú
vs. de
el
mas
mi
se
si
te
tu
of, from
the
but
my
reflexive/impersonal pronoun
if
you (object pronoun)
your

Another common group of such pairs are words like que, which need a written accent when used as a part of a direct or indirect question:

¿Qué dices?   What …?
¿cómo llego?   how …?
Sabe dónde estoy.  He knows where I am.
Digo que hace calor   I say that
como quieras   as…
Estoy donde te dije.   I am where I told you.

(source)