OK, piece by piece ...
Wish + tense agreement + subordinate clause
You're miscategorizing the construction. Both verbs (wish and know) are important,
because they form an idiom (normally in the first person singular, as here: I wish I knew
Furthermore, this is not "tense agreement". There are a number of possibilities for tense usage in subordinate clauses that do not depend on any spurious "agreement" rule.
S is not just any subordinate clause here;
all these examples have disjunctive embedded question complements.
- I wish I knew what he did/does for a living
Either one is correct, and you can also use the progressive -- though the auxiliary be is normally contracted whenever possible. It depends on what you wish you knew.
- I wish I knew what he did/was doing for a living in 1998.
- I wish I knew what he does/he's doing for a living now.
- I wish I knew what he had/has bought her
Again, either is correct, depending. Also again, auxiliary have is contracted if possible.
Simple past is also OK.
- I wish I knew what he'd bought her before she left him.
- I wish I knew what he's bought her now.
- I wish I knew what he bought her.
- I wish I knew what he would/will do in this case
Ditto. Be going to is also OK. And don't forget those contractions.
- I wish I knew what he'd do in this case.
- I wish I knew what he'll do in this case.
- I wish I knew what he's going to do in this case.
- I wish I knew what he was going to do in this case.
(they don't all mean the same thing, of course)
And it's much the same situation with a know complement clause in the pluperfect.
All OK, in context, and many other options.
- I wish I'd known what he had done for a living
- I wish I'd known what he did for a living
- I wish I'd known what he would do in this case
- I wish I'd known what he'd done for a living before he started the school.
- I wish I'd known what he did for a living before I married him.
- I wish I'd known what he'd do in this case.
- I wish I'd known what he was going to do in this case.
Finally, the final question
Are they correct and what the situations are like when hear them?
contains two different very glaring ungrammaticalities.
You should be correcting those instead of trying to understand a mythical "tense agreement" rule.
English tensed clauses require a subject.
There is no subject in the tensed clause when [--] hear them.
It should be when you hear them, when I hear them, when one hears them,
or whatever you mean.
But there must be a subject noun phrase.
English, unlike Putonghua, has very few serial verb constructions.
English wh-questions require Subject-Auxiliary Inversion.
There is no inversion in the wh-question what the situations are like when you hear them?
It should be what are the situations like when you hear them?, or
what are the situations when you hear them like?
I've gone to this much detail because I found something to answer about every line in this question, which makes it a good question, from my point of view.