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)
Verbs of influence are used to express influence over actions that the subject would or would not like somebody else to do, but cannot directly control.
querer, decir, pedir, insistir, 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 direct commands for usted, ustedes, and nosotros and in negative commands for tú and vosotros.
Tú
Camina más despacio. - Walk slower. - Indicative
No camines tan rápido. - Don't walk so fast. - Subjunctive
Usted, Ustedes
Díga(n)me mentiras. - Tell me lies. - Subjunctive
No me diga(n) la verdad. - Don't tell me the truth. - Subjunctive
Vosotros
Comed con nostros. - Eat with us. - Indicative
No comáis los frijoles. - Don't eat the beans. - Subjunctive
Nosotros
Comamos. - Let's eat. - Subjunctive
No comamos. - Let's not eat. - Subjunctive