Communism is a form of socialism.
Yet, pure communism doesn't exist. Neither does pure socialism. Both words are used in so many different ways (especially socialism these days) that there is no clear distinction to be drawn, until you focus on a particular ideology.
- Marxist Communism vs. Anarchist socialism
- Maoism vs. Social Democracy
Socialism is a broad term used to mean a lot of different things.
For some people it's just the idea of everyone helping everyone else out to make sure no one dies from a lack of basic needs (food, water, shelter, etc.). For others it means an economic system, usually the opposite of Capitalism, where things are in place to stop how much capital (stuff that makes money) gathers up in any one person's hands. At it's core though, socialism is always concerned with the idea of the good of the larger number, rather than the pursuit of individual gain.
Some people who believe in Capitalism think that pursuing individual gain helps everyone in the end anyway, but Socialists would disagree with that.
Socialism is also used negatively to describe things people see as getting in the way of successful Capitalism. All governments place limits on the free market ideal of Capitalism to some extent, but when people strongly disagree with how far those limits go, they'll often label them socialism to let people know they think they're bad.
In the United States, for example, someone earning $500,000 a year will pay more in taxes than someone earning $50,000 a year. But (in theory) their children will have access to the same public education system – the person earning $50,000 will be getting a greater return, thanks to government redistribution. While this occasionally comes under attack, however, it is generally considered a good use of the government, so no one labels it Socialism. In many developed countries a similar system exists for health care, and it's often not labeled as Socialism.
In the United States, though, a similar system for healthcare is usually called socialism – even if it isn't nearly extreme enough for a real Socialist to think it is.
There are a lot of different types of socialism, ranging from some schools of Anarchism (like Social Libertarianism) to Communism to Democratic Socialism (like, sort of, in Venezuela) to Social Democracies (Sweden).
Communism is just a special type of socialism. There are actually many different theories of Communism, and they are pretty different. But they all grow out of the teachings of Karl Marx. Marx believed (to simplify) that one of the really important parts of achieving a socialist state was that the people had to own all of the things that made things (capital) collectively, rather than letting individuals own factories, farms, and things like that, which would allow them to become richer and buy more factories and farms. Marx's vision of pure Communism actually required massive technological advances so that we were living in a world of extreme abundance, so that everyone could have anything they needed without anyone else not having it. What most people think of as a 'Communist State' would be seen by a pure Marxist as an intermediary step on the way to real Communism – where the very ideas of capital, class, economies, etc. all disappear, because we don't need them anymore.
Like I say, the words are misused so much that it's hard to really come up with a clear difference. Some people would say the difference is that Communists believe the state has to have a fundamental change of character for a collectivist world to exist, while socialists believe it can be done within the existing state. But socialist Anarchists believe very strongly in the abolition of the state first.
In fact, the great schism between the Anarchists and the Communists in Marx's time came from the opposite disagreement – Communists believed the fastest way to achieve equality was to have the state seize all property and forcibly redistribute it. Anarchists believed that once the state seized all of the property, those in power wouldn't want to then redistribute it. Which is what happened.
To really drive this home, because this is the most important point: while people are trying to answer your question, they're doing it based on the definitions of "Communism" and "Socialism" that they choose to use.
As a result, some of the answers you get are contradicting one another, and most of them are hugely problematic. It's not your fault, because the words are used in public discourse as though they have very clear single definitions, but ultimately the question is like asking: What's the difference between a beetle and an insect?
The problem is that not only is a beetle a type of insect, but it matters a lot what kind of beetle you're talking about, and what kinds of other insects you're comparing them to.