The subjunctive is a "mood", sort of like a verb tense, which is indicated in Spanish by changes to the endings of verbs. There are past, present, and even future subjunctive moods!
The subjunctive is used for far more than just the wishes, suggestions, and desires that Augusta mentioned earlier, though those are the classic textbook answers to "When do I use the subjunctive?".
In reality, Spanish speakers use the subjunctive to indicate a level of uncertainty or to lend a sense that what they are saying is non-factual in nature.
Certainly, wishes, suggestions, and desires are not facts. Things that you doubt are also not facts. Things you are not sure about are not facts. And things that have not happened yet are also not facts!
So the subjunctive is widely used in everyday Spanish speech and writing. It is not only for "expressing wishes, suggestions, and desires", or even the textbook acronym WED that I was taught in high school, where W=wishes/wants, E=emotions, D=doubts. It is used for those specific types of expressions, but also much more!
To give you an idea of the range of uses of the subjunctive in Spanish, here are examples from some classic writers of Spanish-language literature, as well as a couple of other sources:
«Dícenme que gobiernas como si fueses hombre, y que eres hombre como si fueses bestia.»
They tell me that you govern as if you were a man, and that you are a man as if you were a beast. (Don Quijote)
«Uno no es de ninguna parte, mientras no tenga un muerto bajo la tierra.»
A person does not belong to a place until there is (lit. they have) someone dead under the ground. (Cien años de soledad)
«Vivo sólo para que me quieran más mis amigos.»
I live alone so that my friends love me more. (García Márquez)
«Cuando vaya a la playa, me compraré un bañador nuevo.»
When I go to the beach, I will buy a new bathing suit. (Victoria Monera, okay, not a classic of literature but a great resource for learning Spanish! - www.victoriamonera.com/)
«Digas lo que digas, no te creeré.»
Whatever you say, I will not believe you. (Victoria Monera again)
«Escribo los libros que me gustaría leer, y aunque éste tal vez ahora sea un
lugar común, no lo fue hace cinco años que me vino la epifanía.»
I write the books that I would like to read, and although this may now be commonplace, it was not so five years ago when I had the epiphany. (Juvenal Acosta)