That would depend on the tech level.
I mean, you could consider a stone-age hunter-gatherer to be mostly "self-sufficient", by himself. Or, if you want something a bit more "permanent", maybe his family or "clan". The men would hunt and gather food, the women would prepare the catch (work the skin and bones, sew the hides, and so on). As long as these tasks can be taken care of, they are "self sufficient", and they need nothing more. So, maybe 10 or 20 members would be enough.
If you consider a medieval community, a "village" could be as small as a few families.
In fact, you could even have people live with fewer inhabitants (like, a lone farm), but it wasn't usual - mostly because of defensive needs. What would change, here, compared to the stone age, is that the technological needs are higher. I mean, sure, you could use a stone hoe, or a wooden plow, for your field. But if you want metal tools, which are more efficient, you'll need a smithy, which requires know-how (the smith itself), and materials. Which means charcoal (requiring miners, or charcoal burners), and ore (requiring miners). So, either you consider that to be a very infrequent need, which can be fulfilled by trading (which could be the case it the community needs only a few metallic items every so and then), or you consider that to be a constant need (for repairs, renewal, new tools, etc.), and you'll need people dedicated to that, which increases the needed population.
Science, too, requires people. That is, the pursuit (or merely preservation) of knowledge. Educating people requires... people. As teachers, but also as students. And if these students do NOT use what they were taught, they'll forget a lot of it. Which means you cannot afford to teach many people if it's not going to be useful (if it helps in the fields, very good. If it's useful for their trade, why not. If not, they'd be "better off" working already). So, the more advanced the science, the more people you'll need to dedicate to keeping that alive, at the very least (even if you're not trying to discover new things). I mean, "scholars" in ancient Greece could learn about many domains, and know just about everything there "was" to know then. Nowadays, it's impossible for a scientist to be an expert in that many fields. Even just one or two is difficult enough, especially if they have to keep up to date all the time.
For an Industrial period community, once again, depends on what you view as "necessary". If you consider a rural community as "self-sufficient", then food, clothes, and building/combustible materials + builders should be enough. Which means that the size should be around that of a "medieval" community. At the very least, several tens of people, I'd say. But if you want any more, you'll need more people.
If you consider a "journal" to be necessary, you'll need people to write, but you'll also need press (it can be a quite primitive one, printing a single broadsheet, and operated by the person writing the articles) which you'll have to have got somewhere (either by trading, or having been built for you by a craftsman on location), and you'll need paper. Which requires more work, and more craftsmen.
If you need animals (for wool, for milk, for meat, for power - as draft or saddle animals, whatever), you'll need more people.
If you need vehicles, you'll need carpenters or specialized craftsmen.
If you want better roads, you'll need cobblers, and people to cut the stones.
If you want power, you might require steam engines (needing engineers to design them, mechanics to create them, and people to take care of them - like feeding coal or wood to them, lubricate them, etc.) If you need electricity, same thing.
So, depending on your technological needs, and what should be done frequently in your community, the needs for people grow accordingly. If you want the level of comfort of a large settlement (with doctors, education, craftsmen of different trades, along with plenty of materials to work with), you'll need way more people (like, several hundreds, or thousands) than you'd need in a more "rural" setting. So, in a way, it all depends on what you're considering is "needed" to be self-sufficient.
And, of course, for a "modern" community to be self-sufficient, once again, if they can trade for some items from time to time (like, buy a tractor, a harvester, a new machine), they won't need that many people - but keep in mind the needs for fuel and electric power. They'll need regularly scheduled deliveries, for fuel - and a way to get electricity, either through batteries, fuel generators, or a power line.
In that case, from several tens of people to a few hundreds should be enough to have a small, thriving village.
If they need to really be self-sufficient, that is, make everything themselves, then the minimum population will explode, and come to tens or hundreds of thousands, AND have the required natural resources within reach, too (considering the diverse needs for experts, workers in different technical fields, producers of primary products, etc.)