This is addressed in the TNG Technical Manual.
The First Officer is directly responsible for:
- Carrying out the direct orders of the Captain
- Carrying out any standing orders from the Captain
- Carrying out any general orders from Starfleet.
The Second Officer is usually a head of Dept with bridge responsibilities.
- They take control of the ship in the event that the Captain and First Officer are incapacitated
- They serve as OOD for at least one of the ship's shifts.
- They communicate orders from the First Officer to other heads of Department.
- Standard procedure is that the Second Officer should go on all away missions, presumably unless there's a good reason for them not to.
The Operations Officer (below referred to as an Operations Manager) is responsible for:
- Coordinating the various needs of each department (for, for example, EPS power, sensor time, access to critical systems like the Deflector, etc etc)
- Optimising the ability of the ship in order to carry out any missions that are ongoing
- Shuffling priorities in response to orders issued by the Captain and First Officer.
Operational authority for the starship rests with the Commanding
Officer (usually the captain or duty officer). The Commanding Officer
is responsible for execution of Starfleet orders and policy, as well
as for interpretation and compliance with Federation law and
diplomatic directives. As such, the Commanding Officer is directly
answerable to Starfleet Command for the performance of the ship.
The Main Bridge is directly responsible for the supervision of all
primary mission functions. Through the Operations Manager, the bridge
also monitors all secondary mission functions to provide an optimal
operating state. The multi-mission operational profile of the
Enterprise requires extensive coordination between different
departments.
Data wears several hats on the show. He's the ship's Science Officer and Operations Officer as well as serving as Second Officer. One would assume he can carry out all of these tasks simultaneously because of his superb multi-tasking abilities, infallible memory and because he's awake 24/7, if not necessarily on-shift at all times.
For the record, although the Ops role is generally given to relatively lowly ranked members of the crew, it also seems to be a position that's often given to command-track hotshots like (future Captain) Chekov, (future Captain) Kim and (future Captain) Data during their first few tours.