The 20-year-old is reunited with former Shakers boss Richie Barker after his contract at Gigg Lane was cancelled.
Elford-Alliyu scored twice in 13 games for Bury while on loan from West Brom last season and made the switch permanent in the summer, but did not feature under current manager Kevin Blackwell.
Town boss Barker told the club website: "Lateef is a player I know well and I'm delighted to be working with him again.
"He is two-footed, quick and has an eye for goal and will give us something different.
"He can play anywhere along the front four and he's got a fantastic attitude to the game. I used to have to drag him off the training ground - I like that he wants to keep improving."
Another striker, Richard Brodie, is back at the Broadfield Stadium following the conclusion of his loan spell at Morecambe.