Calcualting the number of magnet wire turns and layers in a coil bobbin
For highest efficiency and lowest loss you normally want the resistance to be as low as possible. So you start with the number of turns or length of wire required to produce the desired motor performance, then choose the largest diameter wire that will fit. If you don't know how many turns are required then just put on as many as possible and test the motor on a low voltage. Then adjust the number of turns depending on how much more or less speed/torque you want.

You can calculate the number of wires that fit in a particular area using basic trigonometry, but in practice you will probably need more space due to insulation thickness, uneven winding patterns etc. The insulation on thin wire is a larger proportion of the total area, and the wires are difficult to wind evenly without overlapping. Thick wire may be hard to bend and get in the right position for best packing.

A bobbin is easier to wind and assemble, but wastes space that could be used for windings. Therefore the resistance will be higher, leading to greater loss and more heating - and a plastic bobbin will melt if it gets too hot...