We can reconcile this matter by explaining the difference between period "types." One type is "synodic period," the other is "sidereal period." Mars does have the longest synodic period (780 days), but certainly not the longest sidereal period. Yes, we'll explain the difference. A synodic period is the time required for a given body to return to a given position relative to Earth. A sidereal period is the time required for a given body to return to the same position relative to the stars. We'll use Mars to illustrate this concept. Mars revolves around the Sun every 1.88 Earth years, which is its sidereal period. Earth requires one year to complete its orbit, so its sidereal period is one year.
On April 8, 2014, Earth passed between the Sun and Mars, a configuration called "opposition." Both planets then proceeded along their orbits, with Earth being the faster of the two. A year later, April 8, 2015, Earth returned to the same spot relative to the background stars.* During that same year, Mars barely completed more than half of its own orbit. On April 8, 2016, Earth will again return to the same position relative to the stars. By that time, Mars will have completed an entire orbit since April 8, 2014 and will be partially through another. Earth will "catch up" to Mars on May 22, 2016 when the red planet will be at opposition again: about 780 days after the previous opposition. This span of time is the "synodic period."
Let's pretend, Gort, that Earth stands still. After the April 8, 2014 opposition, only 1.88 years would elapse until the next opposition. Mars' sidereal period would equal its synodic period because Earth would be stationary. Because both planets move, Earth needs slightly more than two years to align itself with Mars after each opposition.
Regard this list of five Martian opposition dates:
January 29, 2010
March 3, 2012
April 8, 2014
May 22, 2016
July 27, 2018
A synodic period separates successive opposition dates. One can use this information to predict the next Martian opposition July 27, 2018 (October 13, 2020.)
Mars has the longest synodic period because it moves such a great distance during each Earth year. Regard Pluto. Its sidereal period is 248.7 Earth years. Pluto chugs lethargically along. After each Earth year, Pluto has barely moved along its orbit, so its synodic period is 367 days. Calculating successive Pluto oppositions is rather elementary. We can establish an inverse relation between a superior planet's distance and its synodic period because the closer superior planets travel along more of their orbits each Earth year than more distant superior planets.
We list the synodic and sidereal periods of the superior planets:
MARS (sidereal: 1.88 years; synodic: 780 days)
JUPITER (sidereal: 11.9 years; synodic: 399 days)
SATURN (sidereal: 29.5 years; synodic: 378 days)
URANUS (sidereal: 84 years; synodic: 370 days)
NEPTUNE (sidereal: 164.8 years; synodic: 368 days)
PLUTO (sidereal: 248.7 years; synodic: 367 days)
Another interesting** note, Mars is the only superior planet whose synodic period exceeds its sidereal period. Mercury's sidereal period is 88 days, but its synodic period is 116 days; Venus' sidereal period is 225 days; but its synodic period is 584 days. We'd explain that, too, if you weren't all now asleep.
*The technical term is the First Point of Aries, defined as the Sun's vernal equinox position, which, of course, is now in Pisces.
**Like "beauty," the adjective "interesting" is variable with each individual.