The subjunctive is not strictly a tense, but a mood that is often used in French to express a particular feeling such as uncertainty, fear, desire, hope in relation to an action.
Some examples of this are:
I want you to do your homework.
Je veux que tu fasses tes devoirs.
She is afraid that he will not come on time.
Elle a peur qu'il ne vienne pas à l'heure.
When you are expressing an opinion using the verb 'penser', the indicative is used unless the phrase is negative. For example:
Je pense qu'elle est là.
Je ne pense pas qu'elle soit là.
While in some cases it is difficult to know when to use the subjunctive, there are certain phrases that always take the subjunctive and these you must learn!
For example, certain clauses ending in 'que' must always be followed by the subjunctive:
il est important que
il faut que
il est dommage que
il vaut mieux que
pour que
afin que
pourvu que
jusqu'à ce que
avant que
à moins que
bien que
de crainte que
en attendant que
It is important to note that there are a few phrases that might catch you out. For example, the verb 'espérer' does NOT take the subjunctive, but the indicative future.
Although it seems like a lot to grasp, you will eventually gain a feel for the right times to use the subjunctive in a sentence.