From Bulbapedia, the community-driven Pokémon encyclopedia.
Pokémon battles are a form of competition between Pokémon. In these battles, one or more of the battling Pokémon is typically owned and trained by a Pokémon trainer. As many as four Pokémon trainers and four Pokémon may complete at once in a Pokémon battle. Trainers battle their Pokémon against wild Pokémon to weaken them for capture.
Pokémon who participate in battle and win earn experience and raise their level.
Progression of Battle
If Fight is selected, the menu of moves the Pokémon knows will appear. The trainer may select one of up to four moves his or her Pokémon knows, and command the Pokémon to use it. The Pokémon may or may not obey, depending on the trainer's Badges and any status ailments (e.g. sleep).
Pokémon may learn up to four different moves. There is a great variety of moves, including attacks, and those with special effects. The kinds of moves that can be learned vary for each Pokémon species. Moves may be effective against, not very effective against, or not affect at all certain Pokémon depending on both of their elemental types. Also, moves may land a critical hit on the foe; when this happens, its damage is doubled.
If Pokémon is selected, the menu of Pokémon in the trainer's party will appear. The trainer may check summaries of information of the Pokémon, or withdraw his active Pokémon and shift it for another.
If Pack is selected, the menu of Items that the trainer has in their bag will appear. The trainer may use one of them on his Pokémon.
If Run is selected, the trainer will attempt to flee from the battle. Trainers cannot flee from battles against other trainers.
Battling wild Pokémon
Pokémon live in many places such as caves and forests, so when a trainer passes through such places, Wild Pokémon may attack them. When they do, they can use a Poké Ball to catch them. A trainer can also have their Pokémon fight wild ones to become stronger.
If a trainer causes the wild Pokémon to faint, it cannot be captured.
The Pokémon anime, trainers don't generally seek out battles against wild Pokémon unless they want to capture one or are defending themselves against an aggressive attack from a wild Pokémon.
A Pokémon battle between trainers is different. In the Pokémon games, when eye contact is made between trainers, they will battle. Trainers cannot run from battles against other Pokémon Trainers. The battle will continue until a winner is decided. The victor is awarded with prize money.
There are two kinds of battles between trainers: single battles and double battles.
In single battles, a trainer is against another, and both may send out one Pokémon each who battle head to head.
(to be added)
In double battles, a trainer may be against two other trainers, or two trainers may be against two other trainers; and depending on if he or she has a allying trainer or not, he or she may send out either one or two Pokémon.
Some attacks can affect both opponent Pokémon, while others affect all Pokémon other than the user.
(more to be added)
Battles in the video games
In Pokémon video games, battles are conducted in a strictly turn-based manner. Before a turn starts, trainers select their action, be it an attack, utilizing an item or switching another Pokémon to battle. Once both trainers have chosen their actions, the turn begins and the actions are carried out, depending on the kind of action and/or the speed of the Pokémon. There are many situations that can contribute to the order actions go in during a turn, or if the action happens at all.
A trainer wins when all of the opponent's Pokémon are defeated. When a Pokémon faints, a trainer may send out another Pokémon. If he or she does not have any more Pokémon who can battle, he or she loses some money, and is returned home or to a Pokémon Center.
Battles in the anime
In the Pokémon anime battles are conducted in a sort of pesudo-turn-based manner. Trainers bark orders to their Pokémon one after the other, there are no concerns about waiting for Pokémon to finish their attacks (allowing for trainers to request immediate defense against attacks), however most, if not all trainers wait for the other to finish talking before telling their Pokémon what to do next.