The 19-year-old Finnish defender will now remain at Loftus Road until the summer of 2019.
Hamalainen has made a total of four appearances for Rangers since his first-team debut against Sunderland in the EFL Cup in September.
"It's great QPR sees a future in me," he told the club website.
Meanwhile, Malaysian pair Johan Raslan and Nazir Razak have been appointed as directors of QPR Holdings Ltd, the parent company of the west London club.
Queens Park Rangers youngster Niko Hamalainen has signed a two-year extension to his contract with the Championship club.