What factors determine stem length ?
Bicycle size is determined first by frame size, which is top tube length, seat tube length, and some more minor geometries like head tube and seat tube angle.  The primary determining factor for comfort on the bike is your reach measurement. 

Although it is affected by various factors, like skeletal flexibility and the type of riding you do, ideal reach is generally considered to be the distance from your seating position, (where you actually rest on the saddle), to your hand position, (where your hands fall when placed in a neutral position on the bar), while your back and arms are relaxed and at roughly equal positions approximately 45 degrees each. Balance is what you are looking for here.

The stem length is a portion of the reach measurement.  That is, reach = saddle setback + top tube length + stem length + bar length. 

Any of these factors can be altered to some degree to produce a correct reach measurement.  But there are other factors which affect this as well.  If your stem is too short, your steering will be too quick to react, as small movements of you body and hands will move your wheel too far, too fast.  This will make the bike difficult to control.  If you go the other way, with too long a stem, then your bike will handle sluggishly, and you might not be able to react quickly enough to an obstacle in the road. 

Based on the measurements that you were given, I would expect that you are approximately 5 foot tall to 5 foot 2 inches.  I think that the shop is likely offering to adapt a bike in their stock to your size, rather than getting you the correct size.  If I am correct about your approximate height, you should be looking for a 47 or 48cm frame which will have between a 65 and 80mm stem on it.  If I am not correct, post your height and riding style, and we can give you more general advice on the correct size.  Best though is to find a shop which specializes in bike fitting, and get a second opinion. I am good at bike fit, but is difficult to accomplish well without having you in my studio.