It takes quite a bit to create a self-sustaining environment. With no food supplies from outside, you would need a shitload of space dedicated to hydroponics and other food generation. Given that the average person eats more than one meal a month (plants grow slowly), we’re talking something about the size of the Mir space station per person just to feed them. Fortunately, the sheer amount of vegetation required would likely also put off enough oxygen to sustain life.
Of course, both those wouldn’t be able to handle a population explosion, so you’d be lucky if you were allowed to reproduce. If everybody had a kid, that’s a 50% increase in food/oxygen requirements, so odds are that if you have any grandchildren, the rest of the ship/station would have to toss you out the airlock in order to avoid suffocation/starvation; one in, one out.
That doesn’t count things like radiation shielding, temperature control, and (arguably, the most important bit) redundant systems so that a single system fault won’t kill everybody on board.