An appendix is the inclusion of details and information that pertains to but would clutter the main text. An attachment is a separate document with unique information that is attached to another document.
An attachment usually follows an introduction of some sort and has information that may be related to but is independent of the document to which it is attached. Although both attachments and appendices are considered supporting documents, an appendix follows the main text and provides further information that may assist readers in understanding the main text but would make the text too difficult to understand if included within the main text.
Just as some texts have multiple attachments, however, a text may include multiple appendices as well. Multiple appendices should be labeled appropriately. Appendices are also primarily features of printed documents.
Interestingly, the two terms are often used interchangeably, particularly in business settings. In various types of businesses, however, the term "attachment" takes on different meanings. In insurance, for instance, it is primarily an addendum, whereas in law it pertains to a specific listing of legal stipulations in pursuant of a court ruling. In technology, an attachment is quite simply a file that is uploaded to supplement another document.