Both elements and compounds can be either homogeneous or heterogeneous. A homogeneous mixture is one in which the composition is uniform throughout. A heterogeneous mixture is one in which the composition is not uniform throughout.
For example, an element such as gold is homogeneous because it has the same composition throughout. A compound such as water is also homogeneous because it has the same composition throughout.
However, a mixture of sand and water is heterogeneous because the composition is not uniform throughout. The sand will settle to the bottom of the container, while the water will remain at the top.