Impact factors can be calculated for journals (journal impact factor) and for authors (author impact factor).
Originally conceived in the 1960s by Eugene Garfield, who started the Institute for Scientific Information (ISI) (now part of Clarivate Analytics), Journal impact factor (JIF) shows the frequency with which the articles published in a particular journal are cited in other research journals. JIF has gained acceptance as a numerical index of journal quality.
However, JIF considers only the impact of journals using the mean number of times published articles are cited during the two years after their publication. It is likely that one article in the journal might have been highly cited and another article hardly at all, but both the authors are judged equally based on the high impact factor of that journal. To overcome this problem, author impact factors have been suggested, which measures the impact of individual authors. Examples include h-index and g-index. H-index is highly popular as an author impact factor.
The h-index was proposed by Jorge E. Hirsch, a physicist at the University of Carolina, San Diego to measure concurrently the quality and quantity of scientific output of a scientist based on the highly cited papers of the author and the number of citations these papers have received from other articles.
H-index addresses the main disadvantages of other bibliometric indicators such as total number of papers, total number of citations, or Journal Impact factors. The h in h-index stands for Hirsch and ‘highly cited’.
No comparison as H-Index is assessment of researchers whereas impact factor is that of journal. If a researcher publishes in a journal of good impact factor there are more chances of citations thus improving H-index of a researcher.
The two metrics cannot theoretically or practically be compared as impact factor measures the journal research influence (mean number of cited articles in the journal during the previous two years) while the h-index measures the researcher combined impact (number of published papers and how many times they were cited).
By analogy, you can think of IF as how powerful your car is, and h-index as how good of a driver you are :).