I was told by an immigration official in the airport that I should take a PCR test at the health center within 24 hours of entering the country.
ご質問ありがとうございます。
"I was told by an immigration official in the airport that"=「私は空港の入国審査官に~と言われました」
"I should take a PCR test at the health center"=「PCR検査を保健所で受けなければいけないと」
"within 24 hours of entering the country."=「入国後24時間以内に。」
ご参考に。