Given a metric measure space $(X,d,\mu)$, a weight $w$ defined on $(0,\infty)$ and a kernel $k_w(x,y)$ satisfying the standard fractional integral type estimates, we study the boundedness of the operators $K_w f(x)=\int_X k_w(x,y)f(y)\,d\mu(y)$ and $\tilde K_w f(x)=\int_X (k_w(x,y)-k_w(x_0,y))f(y)\,d\mu(y)$ on Lebesgue spaces $L^p(\mu)$ and generalized Lipschitz spaces $\mathrm{Lip}_\phi$, respectively, for certain range of the parameters depending on the $n$-dimension of $\mu$ and some indices associated to the weight $w$.