From Bulbapedia, the community-driven Pokémon encyclopedia.
The battle round is an anime-exclusive round in a Pokémon Contest. The purpose of the round is to have the Pokémon battle each other while still making their moves look beautiful. Each round is five minutes long, except for Sudden Death, which has no time limit.
Each contestant begins with a fixed number of points. These points are lost when an opponent's move hits their Pokémon, their move misses, their move doesn't look beautiful, or the contestant is issued a yellow card.
Additionally, contestants can be disqualified upon being found cheating, being issued a second yellow card, or presumably being issued a red card.
A winner in the battle round is determined by one or all of three criteria; whoever has more points when time runs out, whoever loses all their points first, or if one of the Pokémon faints.
If there is a tie upon time running out, the battle goes into Sudden Death where whoever loses all the points first loses.
Sudden Death is an extension of the battle if there is a tie at the end of five minutes. There is no time limit in Sudden Death. The round ends when one person runs out of points.