Stoics and Epicureans where often in dispute with each other, as part of the broader, lively philosophical debates that characterized the Hellenistic schools (for instance, the Stoics vs. the Academic Skeptics). Epictetus explains in a number of places where the Stoa differs from the Garden (e.g., “Against Epicurus,” Discourses I.23), while Seneca tells his friend Lucilius that he happily borrows from Epicurus when it makes sense, as it is his “custom to cross even into the other camp, not as a deserter but as a spy” (letter 2, A beneficial reading program, in the new translation by Graver and Long).
A major difference between the two schools, of course, is that the Stoics thought the pivotal thing in life is virtue and its cultivation, while the Epicureans thought that the point was to seek (moderate, really) pleasure and especially avoid pain. (See here for a broader comparison of various Hellenistic schools.)
Nonetheless, both schools thought that a crucial component of eudaimonia (the flourishing life) was something very similar, to which the Stoics referred to as apatheia (literally “being without passions”) and the Epicureans as ataraxia (literally “tranquility”). There are, however, some differences between the two concepts, especially in the way the two schools taught one could achieve, or at the least approximate, the respective states of mind.
The Internet Encyclopedia of Philosophy has a good entry on Epictetus, which comes with a useful glossary of Stoic terms. Here is what it says about the matter under examination:
apatheia: freedom from passion, a constituent of the eudaimôn life
ataraxia: imperturbability, literally “without trouble,” sometimes translated as “tranquillity”; a state of mind that is a constituent of the eudaimôn life
So, both apatheia and ataraxia are components of the eudaimonic life, and indeed, while the second term is usually associated with the Epicureans, both schools used it.
As far as the Stoics are concerned, it is good to remember that “passion” didn’t mean what we now mean by that term, and indeed it didn’t even mean “emotion” in the modern sense of the term. That’s why it is grossly incorrect to say that the Stoics aimed at a passionless life, or at the suppression of emotion.
Indeed, they divided the “passions” into unhealthy and healthy ones. The first group included pain, fear, craving, and pleasure. The second one “discretion,” “willing,” and “delight.” The latter three where the opposite of the first group, except for pain, which does not have a positive counterpart. Here is a summary diagram (the figure in the background is Epictetus):
So for the Stoics the “passions” are not automatic, instinctive reactions that we cannot avoid experiencing. Rather, they are the result of a judgment, giving “assent” to an “impression.” Therefore, even when you read a familiar word like “fear,” don’t think of the fight-or-flight response that is indeed unavoidable when we are suddenly presented with a possible danger. What the Stoics meant by “fear” was what comes after that: your considered opinion about what caused said instinctive reaction. Stoic psychology was subtle: they knew that we have automatic responses that are not under our control. That’s why they focused on what is under our control: the judgment rendered on the likely causes of our instinctive reactions, a judgment rendered by what Marcus called the ruling faculty (in modern cognitive science terminology: the executive function of the brain).
Again, take a look at the above diagram: pain is not the simple sensation of pain (which, contra lore connected to small-s “stoicism,” we cannot steer clear of), but the failure to avoid something that we mistakenly judge bad. Similarly for the other pathê: fear is the irrational expectation of something bad or harmful; craving is the irrational striving for something mistakenly judged as good; and pleasure is the irrational elation over something that is actually not worth choosing.
Contrariwise, the eupatheiai are the result of a rational aversion of vice and harmful things (discretion), a rational desire for virtue (willing), and a rational elation over virtue (delight). (It should be clear now why there is no such thing as a rational emotional pain.)
I said above that the Stoics too use ataraxia, not just apatheia, in their vocabulary. One way to think about the relationship between the two — consistent with the IEP definitions of the terms — is that apatheia, a shift away from negative and toward positive emotions, in turn yields ataraxia, a sense of tranquillity that comes from having developed an attitude of equanimity toward whatever the world throws at us.
Let me close, however, by highlighting the crucial difference between the two schools that I hinted at above: they most definitely get to apatheia / ataraxia by very different routes. The Epicureans sought most of all to avoid pain, which meant especially to withdraw from social and political life. It was good, for Epicurus, to cultivate your close friendships, but attempting to play a full role in the polis was a sure way to experience pain (physical or mental), and therefore it was to be avoided.
The Stoics, on the contrary, embraced their social role. Marcus constantly writes in the Meditations that we need to get up in the morning and do the job of a human being, which means to be useful to society. Hierocles elaborated on the Cynic / Stoic concept of cosmopolitanism. The motto of the school was “follow nature,” by which it was meant (among other things) the human nature of a social animal capable of rational judgment. And of course one of the four virtues, justice, and one of the three disciplines, action, are explicitly prosocial. For the Stoics the Sage could be happy (meaning eudaimonic) even on the rack, as long as he is exercising his virtue and acting for the benefit of humanity. That would be inconceivable for an Epicurean.