A bit of digging around finds a position, taken from the 7-piece endgame databases, that's claimed as a mate in 549 moves.

However, this isn't a 'constructed' position; there's no theme to the mating sequence, and the moves are the classic 'no rhyme or reason' dance that shows up so much in these multi-piece endgames. As far as actual chess problems go, the longest I was able to find, for a legal position, was a mate in 271 by Nenad Petrovic, seen here.

White starts with 1. Bb1: the core idea here is that White wants to gain access to a6; Black shuttles his king back and forth between a8, b7 and c8, as White plays Ka5-a4-a3-a2-a1, Ba2, Ka1-b1-c1-d1-e1-f1-f2-e1-d1-c1-b1-a1, Bb1, Ka1-a2-a3-a4-a5. Since White has 'lost a move' with the e1-f1-f2-e1 triangulation, Black now has to move a pawn in lieu of moving his King and giving White access to a6. Black's available pawn moves are Pf6-f5-f4, Pf7-f6-f5, Ph4-h3-h2, Ph7-h6-h5-h4-h3 before he finally runs out of pawn moves and must allow White access to a6 to queen his lead b-pawn.
(Note that Bb1 must happen first because the Bishop has to be on b1 whenever the king isn't in the a1-f2 corridor, to prevent Black from winning by playing Pd3! and then queening either the d or c pawns.)