Γράμμα and επιστολή have the same difference as letter and epistle in English. That is, they actually mean the same thing, but epistle=επιστολή is more formal. ;)
γράμμα can also mean "letter" as in "the word chair has five letters", but επιστολή cannot, just as "epistle" does not have that additional meaning.
Επιστολή is a letter inside an envelope you send by mail. Γράμμα is any letter.