To generalise from James K's answer, which gives the condition for a circular orbit...
The condition for the binary to remain bound is that the total energy of the system, which is the sum of the potential energy $V$ and the kinetic energy $T$ (as evaluated in a centre-of-momentum frame) is less than zero.
$$T+V < 0$$
Considering the system as two point masses obeying Newtonian gravity, the gravitational potential energy $V$ is given by:
$$V = -\frac{G m_1 m_2}{\left\| \vec{r_2} - \vec{r_1} \right\|}$$
where $m_1$ and $m_2$ are the masses, $\vec{r_1}$ and $\vec{r_2}$ are the position vectors of the masses, and $G$ is the gravitational constant.
The kinetic energy is given by:
$$T = \tfrac{1}{2} m_1 \left\| \vec{v_1} \right\|^2 + \tfrac{1}{2} m_2 \left\| \vec{v_2} \right\|^2$$
Where $\vec{v_1} = \dot{\vec{r_1}}$ and $\vec{v_2} = \dot{\vec{r_2}}$ are the velocity vectors of the two masses.
Using the definition of the centre-of-momentum frame $m_1 \vec{v_1} + m_2 \vec{v_2} = \vec{0}$, and expressing in terms of the relative positions and velocities
$$r = \left\| \vec{r_2} - \vec{r_1} \right\| \\
v = \left\| \vec{v_2} - \vec{v_1} \right\|$$
and the reduced mass
$$\mu = \frac{m_1 m_2}{m_1 + m_2}$$
the condition can be written:
$$\tfrac{1}{2} \mu v^2 - \frac{G m_1 m_2}{r} < 0$$
Which can be rearranged to give
$$v^2 < \frac{2 G \left( m_1 + m_2 \right)}{r}$$
An easy way to initialize a simulation is to initialise the primary stationary at the origin, pick the secondary's position and velocity to match this condition, then subtract the centre-of-mass velocity from the individual velocities to ensure your system doesn't go wandering off the screen.
What about cases not meeting the condition? If the total energy is exactly zero (i.e. replace the less-than sign with equality), the orbit will be parabolic. If the energy exceeds zero, the orbit will be hyperbolic.
If the relative velocity and relative position vectors are co-linear (or the velocity vector is zero) then the motion will be linear: if the total energy is less than zero then the masses will collide, if the total energy is greater than zero and the velocities directed outwards then they will escape to infinity.