Think yourself a timeline; a bit like a road you're standing on, but since it's one dimensional, very straight, and very strait, and (as far as we know) invariably with a one way sign on it.
Where you are standing is, by definition, the present. When you are writing, occasionally you get so involved in the past you forget you're not actually there, and start describing it as if you were actually living it; this can enhance the immediacy of the action, or confuse the reader totally (Aaargh! When am I?) depending on how well it is done.
We have two main present tenses, present continuous "Is is raining" and – well, just sort of present "I open the door". These can be mixed and matched "It rains on me when I am opening the door" or "When I open the door it is raining" We have present conditional, where one action depends on another "It would rain if I opened the door."
Close behind you is the immediate past, with the perfect tense ("I have opened", "it has rained") which uses an auxiliary verb (to have) with the past participle of the verb (ordinarily an "ed" after the infinitive, but there are enough irregulars to keep anyone happy; assuming memorising lists makes you happy, that is. And different irregularities, too; I think, I thank, I have thunk doesn't cut it. But you know them; you use them in speech.) Then there's the imperfect : I closed the door, it rained (yes, with regular verbs it looks a lot like the past participle, doesn't it?) the continuous perfect (it was raining, I was opening the door) conditional perfect ("I would have opened the door" and I suppose the continuous form "It would have been raining {if I had been stupid enough to open the door}")
Then there is a region even further back on the line, with events that had already occurred when the ones you are describing take place ("it had been raining, but now the clouds were retreating") which I learnt as the 'pluperfect' but believe now has another label. This one is easy; there's only one form of it, and it stretches back to the beginning of history. Interrogative by inverting word order (Had it rained that afternoon?), no conditionals or subjunctives… I think we'll ignore subjunctives for the time being anyway, don't you? There are barely any pedants remaining hard-headed enough to insist on them. So, pluperfect is easy, and logical for flashbacks, but is quite clumsy to write in, and frequently, once the time period is set, an author will regress to simple past (to the expressed complaints of pedants)
Which leaves working out when to use perfect and imperfect (I was, I have been) and I can't think of a convenient rule for which I can't think of an exception. In conventional tale-telling mode, where generally one explains what has already happened, there is a lot more imperfect than perfect tense, but that is hardly a rule.
Future tense is another compound in English, "will" or "shall" with the infinitive of the verb. Future perfect, future continuous perfect, future conditional are all formed exactly as expected – it will have rained, will have been raining, wold have rained – and I'm not ready to explain exactly where they fall on the time line; generally a bit ahead of "now" but not necessarily "when you reach Grandma's house it will have been raining for six hours"
Change when you change place on the timeline, or when the action catches up to "now", and never change without a reason. Not everybody's as sensitive to tense as I am, but jumping around in time disturbs readers; they need timing clues to know when they are in a narrative, and the four time zones: now, then, longer ago and yet to come are the only indications we can give them.
Now, that must be about the most confusing explanations of time structure ever; but at least I didn't try and include time travel…
As I reign over the weather, I will rein in the rain.