Is IQ heritable?
Let me start by saying that there is no commonly agreed upon method to measure IQ (thank you @mdperry). Keeping this in mind...
Yes, studies have shown that IQ is heritable. Or rather, IQ has a heritability that differs from both 0 and 1, meaning that both environment variation and genetic variation plays a role in determining an individual's IQ. Studies show IQ heritability varying between 0.5 (ref) and 0.8 (ref). For more information, please have a look at this post.
To understand the concept of heritability, please have a look at Why is a heritability coefficient not an index of how “genetic” something is?.
What are the genes that contribute to it?
IQ is a polygenic trait, meaning that many loci (locus = position in the genome) are affecting the variation in IQ. For more information about those loci, please have a look at this post.
What I don't understand is if only some people have this 500 genes or all human population has this genes?
Your misunderstanding comes from a misunderstanding about the concepts of gene and allele. You should start by having a look at the definition of the three following terms
Below, I will not comment about the 500 genes claimed in this popular article and will just consider them as valid without considering the complication behind the methodology used for such estimation and about what original articles this popular article is citing.
With the exception of eventual copy number variation, the entire human population share these 500 genes but not everyone has the same allele at these 500 loci.