BB spindle length/chainline for re-used Shimano FC-M391 chainset
The spindle length depends on your frame and on the used crank. The combination of those two will dictate your chainline which should be 47.5mm.
In some cases it can be 47.5-50mm ( see https://www.sheldonbrown.com/chainline.html )
There are also chainlines for other types of bike, the 47.5mm are for Mountain Bikes.

You can measure your current chainline and then calculate the spindle length you need based on the current chainline and spindle lenghth. So for example if you now got a chainline of 52.5mm and need 47.5mm your BB spindle should be 10mm shorter to achieve this.