Decades of twin studies strongly suggest that genes account for around half (or more) of the kinds of relatively stable temperament dimensions measured by the MBTI and Big Five. Note, however, that the genetic side of things is complicated: an introvert's identical twin brother would probably be an introvert, but they might have two extraverted parents. There's more Big Five data than MBTI data, but
here's a study by Bouchard that found significant twin/MBTI correlations on all four dimensions.
The most counterintuitive conclusion that's been drawn from the cumulative data is that
how your parents raise you has almost no influence on your basic temperament — e.g., whether you'll end up an INTJ. Identical twins raised in the same household are not significantly more alike (in terms of temperament) than identical twins raised in separate households.
Now, at this point you may well be thinking to yourself that, if
non-genetic factors account for a third to a half of temperament, it seems awfully strange that how your parents raise you — not to mention all the other "environmental" influences that will be more or less similar for two twins growing up together — has virtually
no effect on your temperament. How could that be?
If you want my personal view, I'm inclined to think that the lion's share of the explanation is probably that the data substantially
understates the genetic component of temperament, and here's why:
Anytime you're doing studies where the results take the form of
correlations, most sources of error are going to introduce
noise into the data that has the effect of reducing the magnitude of the reported correlations. And personality typing involves
multiple sources of significant error, starting with the fact that they haven't even figured out exactly what the nature of the temperament dimensions they should be measuring are, and also including multiple forms of human error in any self-assessment test that can cause the taker to answer a question "incorrectly." What's more, the more you assume (as Jung did, and as various studies suggest) that a relatively large percentage of the population is in or near the middle on one or more of the dimensions, the more mistyped people you should expect as a result of relatively small testing errors.
Assuming that the four MBTI dimensions aren't just arbitrary theoretical constructs and really do correspond to something
real that could theoretically be accurately measured (by, say, directly measuring biological markers of some kind), I strongly suspect that, if every subject was accurately typed, the data would show that a substantially greater proportion of temperament is genetic. And the fact that twins raised in the same household aren't any more alike than twins raised separately would obviously seem a lot less strange if the proportion of temperament that results from "environmental" factors turned out to be very small.