The 18-year-old, who primarily plays as a centre-back, has represented Republic of Ireland from under-15 to under-18 level and made his senior debut at the age of 16 for hometown club Cork City in October 2021.
The Irish teenager later joined Milan on loan for the second-half of the 2021/22 campaign before making a permanent switch to the San Siro the following summer.
The promising youngster, who featured in two pre-season friendlies for Newcastle's under-21 side whilst on trial last month, told nufc.co.uk: "It's surreal to join such a big club like Newcastle. It's definitely a club that is on the rise and with a lot of history. During the last week, I've been so excited to get started and I'm now looking forward to a big season ahead.
"The first thing I noticed when I arrived on trial was the lads were really welcoming and I just want to carry that on into the season, getting to know them more. The people of Newcastle are also really nice, too.
"I have become a much better defender during my time at AC Milan and I learnt so many things to improve my game during my two seasons in Italy which should stand me in good stead for the future.
"The goal, when playing Academy football, is to try and break into a first-team as quick as you can and, hopefully, I can do that at Newcastle United."
Heffernan will link up with United's second-string ahead of Friday's Premier League 2 trip to Reading and becomes Newcastle's second summer signing at second-string level following the arrival of goalkeeper Reece Byrne (below) from League of Ireland Premier Division side Bohemian FC last month.
The 18-year-old shot-stopper, who has represented Republic of Ireland at under-19 level, said: "It's unreal to sign for Newcastle United and a real dream come true. I've always had a football in my hands growing up and it's always been a big part of my family.
"The heritage of the football club was a big factor in my reason to sign. There's a lot of history here, the fanbase is unbelievable and I think it looks like a great place to be at."