The tense shows how realistic the wish is
After ojalá comes the subjuntivo. Its tense shows how realistic you think the wish is: from perfectly possible to impossible to change.
English uses different expressions: hopefully for what may still happen, I wish plus a past form for what is not the case, I wish plus had for what is over. Spanish uses ojalá every time and lets the tense carry the difference.
One wish, three tenses
Ojalá venga mañana.
Hopefully he'll come tomorrow. (possible)
Ojalá viniera mañana.
I wish he would come tomorrow. (unlikely)
Ojalá hubiera venido ayer.
If only he had come yesterday. (over)
Imperfecto - the unlikely wish
The imperfecto de subjuntivo expresses a wish that is not fulfilled now or is treated as unlikely. English also shifts a step back in time here (I wish I had more time, I wish it were easier), so the logic is familiar.
Ojalá tuviera más tiempo.
I wish I had more time.
Ojalá pudiera ayudarte.
I wish I could help you.
Ojalá me llamara algún día.
I wish he would call me some day.
future, but hardly to be expected
Pluscuamperfecto - regret about the past
For something that can no longer be changed, use hubiera + participle. It matches English I wish I had … and if only I had … almost part for part. The difference from the imperfecto is the time reference: now or back then.
Now or back then?
Ojalá estudiara más.
I wish I studied more. (now)
Ojalá hubiera estudiado más.
I wish I had studied more. (back then)
Ojalá no hubiera dicho eso.
I wish I hadn't said that.
Ojalá te hubiera conocido antes.
I wish I had met you sooner.