Let D be a bounded open subset of \(\mathbb {R}^n\) with finite \((n-1)\) -dimensional Hausdorff measure \(|\partial D|\) and let \(x_0 \) be a point of D. We introduce a new harmonic invariant, that we call Kuran gap of \(\partial D\) w.r.t. \(x_0\) . To define this new invariant, denoted \(\mathcal {K}(\partial D, x_0)\) , we use a family of harmonic functions introduced by Kuran (Bull. London Math. Soc. 4, 311-312, 1972). Our main stability result can be described as follows: if \(\partial D\) is sufficiently regular just in one of the points of \(\partial D\) nearest to \(x_0\) , then \(\mathcal {K}(\partial D, x_0)\) is bounded from below by a kind of isoperimetric index, precisely the normalized difference between \(|\partial D|\) and \(|\partial B|\) , being B the biggest ball contained in D and centered at \(x_0\) . This partially extends and improves a stability result by Preiss and Toro. By our stability result, we also obtain new rigidity results: (i) a characterization of the Euclidean spheres in terms of single-layer potentials, improving previous theorems by Fichera and by Shahgholian; (ii) a sufficient condition for a harmonic pseudosphere to be a Euclidean sphere, partially extending and improving rigidity results by Lewis and Vogel.