Heights of algebraic points lying on curves or hypersurfaces