Both sentences are past tense the difference is when they would be said.
"You were warned" would more likely be said long after the instance of the warning being given. "You have been warned." is something that would be said almost immediately after the warning was given and in media it is usually said by the person who gave the warning. For example, if a fortune teller tells you to avoid large groups for 1 week and you say you're going to a huge party tomorrow the fortune teller might shrug and say "You have been warned." It is a very ominous statement suggesting that the warning might be ignored. Both of those sentences can be interchangeable it depends on the context.