It's time we had a talk
Solution 1:
This is an example of a past subjunctive being used to express unreality. At first look it doesn't seem like there's anything "unreal" in the sentence, but consider the difference between the following (from here):
It's time to go to bed
It's time you went to bed
The first expresses that bed time is right now, while the second implies that bedtime should already have happened. Because the sentence is not a simple statement of fact ("this is the time for us to talk") but a statement of obligation ("we should talk/should have talked by now"), the subjunctive is used. It's not necessary to phrase it this way - "It's time to have a talk" is equally grammatical - but the subjunctive construction conveys that extra implication.
Solution 2:
had, an auxillary verb with 4 senses: the sense here is to undergo vocabulary.com sense #2
As in:
"It's time we (undergo/experience) a talk"