I've done a few startups, one successful, many failed.
The one successful startup was with someone I met online. I bought his book, he added me on Facebook. We trolled each other a lot and became friends. When I asked him to join as a cofounder, it was the second time I met him in person.
On the other hand, the biggest failure was something I did with a former best friend and roommate. He was a true hustler, but his approach was very different to mine. He would lie, cheat, and outright refuse to pay partners.
One startup also failed, with a person I knew for years, but not very well. It was a good idea, very solid market. But startups are mentally exhausting and neither of us could push hard enough.
I think the key is really whether you would trust this person. Would you hang out and talk with them for no reason? Would you add them on Facebook? It's a major red flag if you don't.
Basically, would you marry this person? Because that is what a startup really is like. You literally share the same hotel room at times. Sometimes the office is the hotel room. You have to be that comfortable with them.
And you have to make sacrifices. You're sacrificing years of your career for the dreams of this person. You might be sacrificing your relationships with others. I know a person who never saw his newborn son until the baby died, because he was busy with his startup.
It doesn't really matter if you know them for years or days. What really matters is that you're willing to put everything aside and commit to them.