There is no good way to complete the sentence in the second block quote; the second half is flawed.
You might say
He would have invited you to his party, had he had your address.
Which has the meaning you are after. This construction states a possibility; you could replace the first instance of "had" with "if" and get a sentence with the same meaning, or you might finish with "if he had had your address."
If you wanted to keep the "not", you might write:
He would have invited you to his party, but he had not learned your address.
This mean that he has since learned your address, but did not know it at the time he was inviting people to his party.
Grammatically correct or not?
Not correct. It would be a bit unusual, but you could say, "If I know your number, I will call you." You might say this to reassure someone who just gave you their number but is doubtful that you will call.
Yes, this is grammatically correct. It means that if you are given the person's number, you will likely call them in the future.
Yes, this is grammatically correct in modern English. It means that if you had been given the person's number in the past, you would have called them in the past.
Yes, this is the more formal way of writing sentence 3, using the subjunctive voice.