- 我今天喝了咖啡 I had coffee today. Or the sentence focuses more on COFFEE, suggesting you are answering " What did you have?"
- 我今天喝咖啡了 I have had coffee today. In this case, it is more often used as "我今天喝过咖啡了。" Or, the sentence emphasizes on "having coffee", as if answering "What did you do?"/ "What have you done?". And it does imply that you don't have coffee so often, as mentioned by Jack.
Both correct with slight differences as above.
However, we don't mind so much about whether it is Simple Past Tense or Perfect Past Tense like you English speakers do.