Rule of thumb for most things generally is no less than 1 diameter of thread engaged. So in other words, if you have a 10mm bolt, you need to have 10mm or more of thread screwed into the hole.