A general rule for threaded fasteners to be safe (steel bolt into aluminum thread) is 2x the nominal diameter of the fastener. i.e. if you have a M3 bolt then you want at least 7.5 mm of thread engagement length. This 2x ratio should give a factor of safety.
The design principle is that the bolt should fail before the female thread shears. Since you likely have a steel bolt going into a softer and lower strength hole you should add a bit of engagement if possible.
Your fork lower is likely magnesium so I would run a minimum of 2.5x engagement unless the spec indicates otherwise. Ideally you should check with the fork manufacturer for specification.