Yes, the individual number of exons/introns will vary in a transcript, but what you can do is just count all possible exons of a gene
For example, lets say you have an alternative exon in these two isoforms. The XX's are exons
We would say this gene has 4 exons and 3 introns, even though one isoform only has 3 exons. Its the transcript that varies in number of exons, the gene remains constant.
Heres a slightly more complex example. Mutually exclusive exons
We would still say it has four exons. Pretend that every exon of every isoform is included and thats how you get the number of exons in gene. So for the above example, just pretend both mutually exclusive exons are included
According to this old paper there are 8.8 exons per gene (7.8 introns). Their gene number count is high because its older, but they estimate that there are 207,344 introns in the human genome.