The subjunctive mood is used primarily in dependent clauses. Of course, the subjunctive mood is used on other occasions as well, depending on the type of clause, the action/state involved, and its relationship to other elements in the sentences such as the governing verb.
Dependent Clauses (view lesson here)
The subjunctive is usually used in dependent clauses introduced by que or another subordinating conjunction.
Wishes, Hopes, and Fantasies (view lesson here)
esperar, ojalá que, etc.
Yo espero que a Juan le guste la música.
I hope that John likes the music.
Requests, Suggestions, Intentions (view lesson here)
Use the subjunctive to express influence over actions that subject would or would not like somebody else to do, but cannot directly control.
querer, decir, pedir, insistir en, preferir, recomendar, etc.
El profesor quiere que tú hagas la tarea.
The teacher wants you to do the homework.
Express Doubt, Possibilities, Uncertainties (view lesson here)
When the main clause expresses less than 100% certainty about the truth of a que-clause, the verb is in the subjunctive.
pensar que, quizás, tal vez, no saber, no creer, dudar, negar, es posible, es probable, etc.
Es probable que el tren llegue con retraso.
The train will probably arrive late.
Marcos duda que el jardinero trabaje hoy.
Marcos doubts that the gardener will work today.
Es posible que vayamos a la playa mañana.
It's possible that we'll go to the beach tomorrow.
Unrealized or Hypothetical Events, Situations, or Entities (view lesson here)
cuando, en cuanto, mientras, hasta, etc.
Le hablaré cuando vuelva.
I will speak to him when he returns.
Llámame en cuanto llegues.
Call me as soon as you get there.
Expressing Judgement or Emotion to an Event (view lesson here)
The subjunctive mood is used in a subordinate clause following the expression of an emotion or judgement.
sentir, alegrarse de, es bueno, es malo, es una lástima, es increíble....
Me alegro de que hayas venido.
I am glad that you have come.
Necessity or Obligation (view lesson here)
es necesario, es preciso, hace falta que, etc.
Es necesario que usted coma.
It is necessary that you eat.
Es preciso que trabaje.
It is necessary that you work.
Commands (view lesson here)
Use the Subjunctive in all commands for usted(es) and nosotros. Use the Subjunctive in negative commands for tú and vosotros.
Affirmative Commands: Sentémonos ahora. -- Dadles el dinero.
Negative Commands: No me lo digas. -- No les déis el dinero.
Clauses introduced by the conjunction si (view lesson here)
Clauses introduced by the conjunction si 'if', which typically expresses a hypothetical condition, do not require the subjunctive.
Time Expressions (view lesson here)