It depends.
Some men come in seconds ('OMG sex with a real other person!!!') and some take forever or don't come at all ('This doesn't feel like the way I've been masturbating for years...') If you can control when you come during masturbation and you're not using a hard and fast action when you do, you will probably be fine.
The best suggestions are to ensure you have plenty of time so that if it does happen, you can have another go, and to lose virginities with people with whom it doesn't matter if it's not that great the first time. This may well mean people you're in a relationship with rather than a semi-anonymous quickie.