"I had a test today at school." is a statement explaining what your day consisted of. So this could answer someone's question if they asked what you did today.
"I had an exam at school today" is another way to phrase to explain that you had a test. The word "exam" is short for "examination" which is another word you could use along with "test".
Both "test" and "exam" are things that you participated in answering questions on a certain topic or subject.
"I had a test today at school."(今日は学校でテストを受けました)は、その日の出来事を説明しています。「今日は何をしたの」という質問の答えとしても使えます。
"I had an exam at school today"(今日は学校で試験を受けました)は、「テストを受けた」と伝える別の言い方です。"exam" は "examination" の短縮形です。"test" と同様、これも使えます。
"test" と "exam" はどちらも、特定のテーマに関する質問に答える場をいいます。
In common usage, you can put the word "today" at the beginning or the end of a sentence.
In my second answer, I used the phrase "most of my day was taken up with". This is not to be taken literally. Instead, this is meant to explain that the most important and noteworthy thing you did was to take an exam.
"today" という言葉は文頭でも文末でも使われます。
二つ目の例では、"most of my day was taken up with" というフレーズを使いました。これは文字通りの意味(一日のほとんどの時間は~に取られた)ではありません、その日にした最も重要で注目すべき出来事が試験を受けたことだったということです。
When talking about tests as a student, it's not necessary to mention school as it is implied. You can be specific about which exam or just say that you had one.
I went to school to take an exam (today).
(今日は)学校に行って試験を受けてきました。
take an exam は「試験を受ける」という意味の英語表現です。
exam の代わりに test を使っても良いでしょう。
お役に立てれば嬉しいです。
またいつでもご質問ください。