The Spanish subjunctive is a mood and not a tense.
It is used in many different occasions:
When the subject of the clause changes e.g. I want her to go to the shop
After a verb that expresses a wish, desire, preference, suggestion, or a request. e.g. My mum hopes that I can go to university.
After a verb that expresses doubt, fear, joy, hope, sorrow and other emotions. e.g. I doubt that he will succeed.
4.After impersonal expressions that show necessity urgency, importance or possibility e.g It is important that we study for our exam.
After certain conjunctions of time such as antes (de) que, cuando, en cuanto, hasta que e.g. I will stay here until he returns.
If the noun before the adjective is indefinite, vague, negative or nonexistent. e,g I'm looking for a book that is intteresting.
How to form the present subjunctive with regular verbs:
You go to the present indictative , the first person singular and you drop the 'o' ending and add for -ar verbs: e, es, e, emos, éis, en and for -er/ ir verbs: a, as, a, amos, áis, an.
There are irregular verbs that you need to memorise. These verbs include dar, ir, salir, hacer, estar, ser.