Spanish places events in time with a small set of prepositions — and they don't map one-to-one onto English:
A las tres tengo clase. (At three o'clock I have class.)
Trabajo por la mañana. (I work in the morning.)
En agosto vamos a la playa. (In August we go to the beach.)
Quick rule: a = clock time; por = part of the day; en = months, seasons, years.
Use a + la(s) for the time something happens:
La clase empieza a las nueve. (Class starts at nine.)
Como a la una. (I have lunch at one — singular "la una"!)
El tren sale a las ocho y media. (The train leaves at half past eight.)
Asking: ¿A qué hora…? (At what time…?) — ¿A qué hora cenas?
Use por for the section of the day, with no exact hour:
por la mañana (in the morning) — Estudio por la mañana.
por la tarde (in the afternoon/evening) — Trabajo por la tarde.
por la noche (at night) — Veo la tele por la noche.
With an hour, switch to de: a las diez de la mañana (at ten in the morning).
En covers the bigger time containers:
Months: Mi cumpleaños es en marzo. (My birthday is in March.)
Seasons: En invierno nieva. (In winter it snows.)
Years: Nací en 1995. (I was born in 1995.)
But days of the week take NO preposition: El examen es el lunes. (The exam is on Monday.) — just the article.
For ranges and durations:
desde (since/from) — Vivo aquí desde 2020. (I've lived here since 2020.)
hasta (until) — Trabajo hasta las seis. (I work until six.)
de…a (from…to) — La tienda abre de nueve a dos. (The shop opens from nine to two.)
durante (during/for) — Estudié durante tres horas. (I studied for three hours.)
To sequence events, use antes de (before) and después de (after):
Antes de cenar, hago los deberes. (Before having dinner, I do my homework.)
Después de clase, voy al gimnasio. (After class, I go to the gym.)
Después del trabajo, ceno con mi familia. (After work — de + el = del.)
Followed by a verb? Use the infinitive: antes de salir (before leaving), never a conjugated form.
Traps for English speakers
These are the errors English speakers make most often.