To properly answer your question, I think a course in light metering and exposure would be necessary, but this is beyond the scope of this forum. I will try to keep it short.
Your question is by no means confined to the boundaries of Polaroid cameras. As a matter of fact, the answer to this question applies to photography in general, be it film or digital.
Most cameras have a built-in light meter to determine the correct exposure, and those that don't need a user with an external light meter, so they can set the exposure manually.
The exposure is deduced from the light available in the scene, and in particular the light that falls onto the light sensitive meter.
Now, if more light is present, the exposure is typically shorter, and vice versa. Exposure is dependant on light, ISO, aperture, and shutter speed (with film, ISO is locked into the film, digital cameras allow you to change the sensor's ISO). Point and shoot cameras, like the Polaroid cameras you own, will just pick these settings (aperture and shutter speed) for you. Look into shutter priority, aperture priority and manual mode if you want to learn more on how other types of cameras handle this.
So to answer your first question, the camera decides the shutter speed based on the light available, and on the set aperture. Specifically, these two cameras base their aperture on the distance to the subject, and are likely to open up the aperture when the subject is closer to the lens, to aid in background separation.
I have already semi-answered your second question. If you want to do a long exposure the manual way (as in, you don't let the camera choose the exposure), then you need to meter the scene and figure out the exposure yourself. I must add that knowing how to expose and meter light is key in photography, if you want to progress beyond the significant boundaries fully automatic cameras/modes have.
I don't know how the third question could be answered in any other way than you did yourself:
[...] it is possible to get longer exposures if I press the button to open the film slot after pressing the button to take the shot (for old cameras), and this operation can be done with the new One Step 2 camera by turning off the camera while holding the shot button.