When will that happen and who will decide it? Or is it hard coded in the model based on some calculation? Please enlighten me

Hard coded.
It's halved every 210,000 Blocks, so the closer we are to 21,000,000 BTC generated, the closer this reward will go towards 0.
Below, there's an estimation:
https://en.bitcoin.it/w/images/en/e/e3/Total_bitcoins_over_time_graph.pngMiners will, however, always get the transaction fees that people are willing to add onto their transactions (check yout Bitcoin settings for that).