The AtMega1284P has an internal 20MHz oscillator.
No, it doesn't.
Or you're not understanding the difference between an oscillator circuit and an oscillator module.
The ATmega1284P has a built-in "calibrated" RC oscillator module that runs at approximately 8Mhz.
And another module that runs at about 128kHz and isn't calibrated.
It also has a couple of "crystal oscillator circuits" that are designed to work with an EXTERNAL crystal as a timing reference (up to a 20MHz crystal), which is what the schematic you referenced shows.
There is another kind of external crystal oscillator that includes both crystal and some electronics to make it oscillate (typically has 4 pins, two of which are for (significant amounts of) power.
You'd use an external crystal with the chip's internal oscillator circuits whenever you want a frequency other than the 8MHz, 1MHz (with a divider), or 128kHz provided by the completely internal circuits, OR you want better accuracy than the internal oscillator circuits (which do NOT have a crystal) can provide.