The 33-year-old, who previously played for Leeds, Everton and Leicester, has scored 160 goals during his career.
He scored once in 18 appearances for North End in the 2016-17 campaign.
"I have no doubt that there will be a few disappointed Championship and League One clubs once they hear the news that we have secured his signature," said Bury boss Lee Clark.
Beckford added: "The vision that has been shown to me by the manager and the chairman just blew my mind.
"The motivation for me to come to Bury is the overall project that the chairman and manager have explained to me. I'm excited to be a part of it and just want to get going as soon as we can."
Find all the latest football transfers on our dedicated page.
League One side Bury have signed striker Jermaine Beckford on a two-year deal following his release by Preston.