Fun fact: The English modal verb can bears its etymological roots in the same morpheme, which has also given the verb to know. This example from Russian shows "how" the two have diverged to get their present meanings ;)
They mean the same. Отец is the formal word that you would see in documents and will probably use for "fathers" of people you barely know. Папа/Мама are what you most likely use for your own parents an are likely to use for parents of your friends in informal conversation (отец/мать are an option).
If you are being formal and serious you might as well use отец for everyone. The formality difference here is bigger than that of English father/dad but not extremely large. Personally, I only use папа and мама when talking to my siblings but I might call my parents отец and мать with my friends.
I'm not a native speaker but I figure it's about formality. отец = father and папа = dad