An "end" or "end in itself" is the end result, the ultimate goal, the final conclusion. A "means to an end", therefore, is a way of getting to a given goal.
So for example, if I want to lose ten pounds, I might start running to lose weight. For me, running is a means (the very act of running) to an end (losing the weight). I could also start dieting; I don't want to eat less but it is a means to an end. If, however, I actually like running, the act of running is itself the end, so the expression would not be appropriate.
A related expression is "The ends justify the means." This phrase is used when the end result justifies whatever action was used to get there. The main character in a movie who wants to avenge a murdered loved one might go on a killing rampage to get at the murderer, and you might say that for her, the ends justified the means.