We'll need a bit of background to explain this. We describe the expansion of the universe by a scale factor, that we write as $a(t)$. Note that this scale factor is a function of time, and by convention we set the scale factor to have the value one right now.
Suppose we have some pair of points in space that are a distance $d_0$ apart right now. The scale factor tells us how the distance between these points changes with time:
$$ \ell(t) = \ell_0\,a(t) \tag{1} $$
As I said above, the current value of the scale factor is $a(\text{now})=1$ and if we put this into equation (1) we get:
$$ \ell(\text{now}) = \ell_0 \times a(\text{now}) = \ell_0 \times 1 = \ell_0 $$
So far so good. In an expanding universe the scale factor is increasing with time, i.e. $a(\text{tomorrow}) \gt a(\text{now})$ meaning that:
$$ \ell(\text{tomorrow}) = \ell_0 \times a(\text{tomorrow}) \gt \ell_0 $$
So the distance $\ell$ between our points increases with time, and this is what we mean when we say the universe is expanding.
If we want to know the rate at which our length increases we differentiate $\ell$ with respect to time:
$$ \frac{d\ell}{dt} = \frac{d}{dt}\left(\ell_0\,a(t)\right) = \ell_0\frac{da}{dt} $$
And if we want to know the rate at which the length change is accelerating we differentiate it again:
$$ \frac{d^2\ell}{dt^2} = \ell_0\frac{d^2a}{dt^2} $$
For brevity we write $d^2a/dt^2$ as $\ddot{a}$ and that's what I'll do from here on.
Anyhow, the point is that if we consider some imaginary measuring rod of length $\ell$ then the ends of the rod will be accelerating away from each other at $\ell\ddot{a}$ so if we want to keep the length of the rod constant we need to apply an opposite acceleration of the same magnitude. So all we need to answer your question is to calculate this acceleration and set it equal to the acceleration caused by the gravitational force of your two masses.
The value of $\ddot{a}$ is given by the second Friedmann equation. This equation comes from general relativity, but we luckily don't need to know GR and we can just use the equation:
$$ \frac{\ddot{a}}{a} = -\frac{4\pi G}{3}\left(\rho + \frac{3p}{c^2}\right) + \frac{\Lambda c^2}{3} $$
where $\rho$ is the average density of matter (both normal + dark matter) and $p$ is the pressure. The pressure is effectively zero for our universe, and since right now $a=1$ the equation simplifies to:
$$ \ddot{a} = -\frac{4\pi G\rho}{3} + \frac{\Lambda c^2}{3} $$
If you take your two equal masses $m$ separated by a distance $\ell$ then the gravitational force between them is:
$$ F = -\frac{Gmm}{\ell^2} $$
where the minus seen means the force is attractive. The acceleration $A$, given by $F/m$, is:
$$ A = -\frac{Gm}{\ell^2} $$
And all we have to do to answer your question is to set this gravitational acceleration $A$ equal to minus the universe acceleration $-\ell \ddot{a}$ so they balance out. This gives us:
$$ \frac{Gm}{\ell^2} = \ell\left(\frac{-4\pi G\rho}{3} + \frac{\Lambda c^2}{3}\right) \tag{2} $$
So to get the value of $\ell$ just feed in the average matter density $\rho$ and the cosmological constant $\Lambda$, then solve for $\ell$. I'll leave this as an exercise for the user.
However, before closing there's an interested and perhaps unexpected result from this. Suppose we ignore dark energy for a moment, then equation (2) gives us:
$$ \frac{Gm}{\ell^2} = -\ell\frac{-4\pi G\rho}{3} \tag{3} $$
But there's something wrong here. We have a positive number on the left equal to a negative number on the right, and that can't be the case. So what has gone wrong?
The answer is that if there is no dark energy the expansion of the universe is decelerating i.e. $\ddot{a}$ is a negative number. That means if you take any two points in this universe they are accelerating towards each other. So when you take two masses that are stationary relative to each other those points will accelerate towards each other even without any gravitational force between the masses. This means there is no distance where the expansion of spacetime and the gravitational force balance out, and that's why we get the equation (3) above that has no solution.
So your two masses can only remain stationary if dark energy is present, and specifically they can only remain stationary if the acceleration due to the dark energy is greater than the deceleration caused by the matter density:
$$ \frac{\Lambda c^2}{3} \gt \frac{4\pi G\rho}{3} $$
Assuming you're still with me you've probably spotted something odd about what I've just said. I've told you that without dark energy any two masses will accelerate towards each other, but how does this fit with the expansion of the universe? Wouldn't what I've said mean the universe must be contracting not expanding?
The apparent contradiction is because we specified at the outset that the two masses were initially stationary relative to each other, but this isn't true in general. If you look at a distant galaxy it isn't stationary relative to us but instead is moving away at a velocity given approximately by Hubble's law:
$$ v = H\ell $$
In a universe without dark energy the distant galaxy would be decelerating, i.e. accelerating towards us, but since it is currently moving away at $v = H\ell$ the distance from us to it is still increasing.