It is important to note that the subjunctive is a mood rather than a tense. There are however different forms of the subjunctive (present/imperfect/perfect/past perfect). You must choose which one is applicable by looking at the phrase and whether it is in the present, past or future.The subjunctive is a mood of possibility. In light of this, it must be used when expressing doubt (dudo que), denial(niego que), emotion (me alegro que) or a wish (ojalá).There are however certain fixed expressions which require the subjunctive, such as general assertions: es importante que, es fantástico que, es imprescindible que..The subjunctive is also used in commands when they addressing someone in the usted form or when the commands are negative.It is also used when there is a change of subject and someone influences somebody else (quiero que lo hagas).