The 26-year-old will formally join the Championship club on 1 July.
Elliott, previously of Stockport and Cambridge United, scored 13 goals for League One side Wimbledon last season.
"Tom's a player I've admired for some time now," said Millwall manager Neil Harris. "We've had local allegiances with Wimbledon, so I've been able to watch him a few times."
"I'm really pleased to bring him in. He's a target man who has progressed really well under Neal Ardley over the past two years and has developed into a physical player with a good goalscoring record."
Find all the latest football transfers on our dedicated page.
Millwall have signed AFC Wimbledon striker Tom Elliott on a two-year contract.