We present a polynomial partitioning theorem for finite sets of points in the real locus of a complex algebraic variety of codimension at most two. This result generalizes the polynomial partitioning theorem on the Euclidean space of Guth and Katz, and its extension to hypersurfaces by Zahl and by Kaplan, Matouˇsek, Sharir and Safernov´a. We also present a bound for the number of incidences between points and hypersurfaces in the four-dimensional Euclidean space. It is an application of our partitioning theorem together with the refined bounds for the number of connected components of a semi-algebraic set by Barone and Basu. Contents