How long you should wait depends on the vibe, the type of girl and other variables such as availability.
For instance, if you’re visiting Vegas for a weekend of fun and happen to get a girl’s phone number, and she’s only there for 2 days, it’d be quite frikkin’ stupid on your part [the guy’s] to wait 4 days to contact her.
By that time; she would’ve been gone! So in such a case with such a girl, it’d be expedient and wise to contact her right away in order to set something up.
Waiting is not an option!
That is a perfect example where you as the guy must execute social intelligence opposed to relying on a communication rule.
Now if this happens to be a chick from your town or city, there’s no real need to contact her right away in order to seal the deal since you’ll always be able to do that at a later date.
All in all, the question of “when” you should contact a new girl for the 1st. time depends.
It could be 5 minutes later, 5 hours later or 5 days later. Neither is wrong; neither is set-in-stone correct, but all subjective.
When it comes to Facebook messaging a girl who had just accepted your friend request, here again, you must take other factors into consideration.
However, as a rule, this is what you should do regardless of the girl and the situation: Send her a little text right away as a primer for what to come later [later meaning days later].
You are NOT thanking her for accepting your friend request!
I repeat: Do NOT fucking send her a message thanking her for accepting your friend request!
It is cheesy and makes you come off as a low-valued guy [DLV: Demonstration of Low Value].