They are similar, in the same way that friend and buddy are in english. Ami is a little more generic, and copain a little more familiar or affective. But really they are equivalent words. Feminine : amie and copine.
Ethymologically ami is someone you like and copain someone with whom you share bread. So generally copain is a better/closer friend than a standard friend, while ami is generic and can mean both.
As stated by Jojo and Anatheme, petit-ami and petit-copain are translations for boyfriend, but note that the sole word copain depending on context can mean that too, so be aware there is potential misunderstanding.