Public comment on the B777 that landed short of the runway at Heathrow has made me realized how little the general public understands of pilot duties during a flight. People are aware that there are two people up front, but are often quite vague on what they do.
Both of the people sitting in control seats in an airliner are fully qualified pilots. They have taken the same training and passed the same tests on the systems, handling and emergency procedures. Either pilot is capable of flying the airplane without assistance from the other. The main difference between the tests they take is the seat they sit in: left or right.
The pilot who is in charge of the flight is called the captain, and sits on the left. She is responsible for the decisions made by the pilot in the right seat, The second pilot might be called the "co-pilot" or the "first officer," often abbreviated FO (eff-OH). The same pilot might work as captain on one type of airplane and FO on another, for the same company. At some company all pilots are qualified as captains (i.e. they have taken their tests from the left seat) and just take turns sitting in the left seat and being the pilot-in-command.
For each "leg" (from take-off to landing) one of the pilots is designated the flying pilot and the other is the non-flying pilot. In a typical operation, pilots alternate in these duties from leg to leg. The typical division of labour is that the flying pilot handles the controls and the non flying pilot tunes frequencies, programs the flight computer, talks on the radio and does other 'support' tasks for the person flying. That means that if the first officer is flying he or she gives commands to the captain, like "set take-off power" "gear up" or "could you adjust the sunvisors so I don't go blind up here."
All the main controls are accessible from or duplicated on both sides of the cockpit, but there are a few exceptions. If a circuit breaker needs to be pulled, it's often on the captain's side, so the captain transfers control of the airplane to the first officer in order to find the circuit breaker. And often steering on the ground is controllable only from the left side, so after the first officer has landed, the captain takes control and taxies the airplane to parking.
The two pilots work together as a team and practice communication just as much as piloting skills. Control may be passed back and forth during a flight for various reasons, like someone eating lunch or getting up to go to the washroom. If there is a particular challenge during the flight, control may be passed to the pilot who is best at it, or the one who wants to practice it.
That is fairly uncommon though, so if you hear of an incident where, as in Heathrow, the first officer was handling the airplane, that probably just means that the pilot in the right seat was the one who happened to be flying at the time the incident occurred.