Attacks do not begin until you reach Level 3 Settlement status. After this has been obtained it is only a matter of time and every settlement is different.

It could be only a few hours or it could be days. One never knows so it is a good idea to increase your settlement’s defenses before you reach level 3 as you might lose your first attack if you don’t.