Micro Econ Question

It's been about four years since I took micro econ, and I remember that you're supposed to produce up to the quantity where marginal revenues equal marginal costs. Is this the same quantity where the marginal cost curve intersects the average total cost curve, thus achieving maximum economies of scale? Or do they not necessarily have to be the same quantity? Thank you!