They both translate into "experience" in English.
"Ein Erlebnis" is something you experience, like an event:
Diese Reise war ein Erlebnis.
Ich habe letzte Nacht ein furchtbares Erlebnis gehabt.
It is from "erleben", which means to experience something. It typically describes exciting things. The mentioned voyage was definitely not boring. This does not necessarily mean it was good, though without further explanation, it is likely positive.
"Eine Erfahrung" (note the article) is similar to an Erlebnis, but more neutral. It typically means that you gain something from it:
Diese Reise war eine interessante Erfahrung.
This voyage may have been a pleasure and there was a lot to see, but it might not have been exciting. Maybe it was, but the sample sentence does not mention it.
It is from "erfahren", which means to experience something, not only in the sense of "erleben", but also like getting something personally (be it positive or negative):
Sie hat große Anteilnahme erfahren.
However, "Erfahrung" (this time without an article) is also experience in general, i.e. your knowledge or expertise (and also experience in role playing games):
Seine Erfahrung spricht für sich. Er hat Erfahrung darin, sich aus allem herauszureden.
The area to which this knowledge or experience applies can be limited. For example, if you made a few flights with a specific airline and are generally satisfied, you can say:
Mit dieser Fluglinie habe ich gute Erfahrung(en) gemacht.
In this case, you can also use the plural to emphasize that it happened more than once, but the meaning is still the same. This should not be confused with having had a single good Erlebnis:
Mit dieser Fluglinie habe ich eine gute Erfahrung gemacht.
If you try to find out something, you can also say:
Ich versuche, die Abfahrtszeit des Zuges in Erfahrung zu bringen.
Of course, you can also say that you got the information:
Ich habe sie in Erfahrung bringen können.
You're right, both words mean "experience" in English, but with different connotations.
I'd put it this way. An Erlebnis is a special Erfahrung; it's like a little adventure. It can be good ("schönes Erlebnis") or bad ("schlechtes/böses/schlimmes Erlebnis"). It's a much stronger, vivid experience than just an "Erfahrung."
It's worth mentioning that the word "Erfahrung" has two meanings (like in English):
- a specific experience:
Meine Zeit in Island war eine schöne Erfahrung.
Mit diesem Unternehmen habe ich eine schlimme Erfahrung gemacht.
- experience you get from doing something (often over a longer period):
Die Ärztin hat viel Erfahrung in der Behandlung dieser Krankheit gesammelt.
Die Firma sucht einen Verkäufer mit langjähriger Erfahrung.
I would say the main difference is a time-related one.
"Erlebnis" is more like an event, it happens in a very narrow time frame; and usually only once. As mentioned above, it derives from "erleben". Leo.org gives a nice and close translation for erleben: "live to see".
So, Erlebnis focuses more on the occasion, the underlying event or the thrilling happening. (But with a more personal view than "Ereignis" - "Erlebnis" really suggests there is someone who "lived" through that event.)
"Erfahrung" is much more a long-term concept. "erfahren" also means "gaining knowledge", so from an "Erfahrung" you'll usually learn something or at least get a memory that won't go away. (and, as splattne has already mentioned, it also refers to the knowledge itself, something you can't learn from books but only from life.)
So Erfahrung focuses on what stays from an event. It's also more likely to be used in a negative way, as in "well, this wasn't really nice to endure, but at least we've learned something from it."
An Erlebnis is just something that you have experienced. For example
I have erlebt that people in China eat with chop sticks instead of a knife and a fork.
It just means that you have experienced it once but it doesn't say anything about you being able to eat with chop sticks.
When you say that you have Erfahrung with eating with chopsticks, it will mean that you have done it before and that you know how to do it.
"They both translate into "experience" in English." But "Erfahrung" is in the long term, and "Erlebnis" is in the short term.
The root word of "Erfahrung" is "fahren," which means to "travel." The kind of "experience" you get in that context is accrued over a long time, like work experience.
The root word of "Erlebnis" is "leben," which means to "live." In this case, you "live" through an "experience, typically over a short period of time.