The 26-year-old turned down a one-year Saddlers deal after scoring four goals in 44 appearances last term, helping them to the League One play-offs.
Cook played under Hatters boss Nathan Jones in Charlton's under-21 side.
"Jordan is one I've known for a long time and he's one I never felt fulfilled his true potential at Charlton," Jones told the club website.
"He's got a lot more to give and hopefully we'll see that at Luton."
Find all the latest football transfers on our dedicated page.
Luton Town have signed forward Jordan Cook on a two-year deal after he rejected a new contract at Walsall.