There are a few differences.
Gomaweo (고마워) is from the verb gomapta (고맙다), which is the native Korean word for 'thank you'.
Gamsahamnida (감사합니다) is from the verb gamsahada (감사하다), which is a combination of Chinese gan3xie4 (感謝) and 'hada' (which by itself means 'to do' but is commonly used to turn nouns into verbs in Korean) and also means
'thank you'.
So there are two things to understand here: (1) the difference between the two words and (2) the difference in politeness level of the verb endings.
(1) 'Gamsahada' as a Sino-Korean word (i.e., it's of Chinese origin) is more formal than the native Korean equivalent 'gomapda'. This is generally true of foreign loanwords versus native words in most languages.
(2) The '-mnida/seumnida' verb ending is itself both polite and formal whereas the 'eo' ending on 'gomaweo' is casual and informal (this style of speech is called 'banmal').
You can use either style with either word to get the following four possibilities (there are others):
gamsahamnida (감사합니다): this is both polite and formal. It's the most formal choice.
gamsahae (감사해): this is casual but not someone one would naturally say. You'd just use 'gomaweo' or, for really causal speech, even just 'gamsa' by itself.
gomapseumnida (고맙습니다): this is both polite and formal but not as formal as 'gamsahamnida'.
gomaweo (고마워): this is casual and is more like 'thanks'. You can use it with people of the same or lower status with whom you are close but not with seniors.