The answer is "yet unknown, but we have a known current record holder".
There are two main sources for records.
- Chess problems. The longest "mate in n" which is also testedly correct (in the pre-computer age there were even longer attempts) is around 300 moves. This is also probably the maximum - there are only so many Black pawn tempo moves and long zugzwang triangulations to give the move to Black, so you won't get much more than 300 moves that way (this even holds with positions which are illegal due to impossible chains of pawn captures). See also here on CSE.
- Table bases. By listing all mate positions, then working backwards (finding all mate in 1, then mate in 2 etc.), a computer can in principle know the value of any position without a doubt. For example KQ/K is at most #10 for any position. For time and space reasons, though, the table bases are currently known only for 7 pieces at most. This means:
- The current record holder for the longest mate with ignoring the 50 move rule was implicitely given by Allure in his link: 549 moves. I give another with some additional info: see here. EDIT: Newsflash! Make that 584 (contains a promoted B).
- Snag 1: If we now play by the 50 move rule, that game would have been drawn long ago. To my best knowledge, the record holder for this variant is unknown, and it would be quite a feature to repeat all the calculations. This would be best asked in a chess programmers community. We have a contender, though: see here on CSE, found accidentally. Note these are 364 plys, which are only 182 moves, so in this case, problem chess is still in front!
- Snag 2: The 8-piece table base are fervently in the works, don't hold your breath. If you now expect any additional piece will break the record exponentially: Nope. An email with preliminary results by Marc Bourzutschky argues possible exchanges lower the record lengths, and for this reason the author expected we already are close to the natural maximum.