As you surmise, sir, 989.M41 is the 989th year of the 41st Millennium.
138.997.M41 is the 138/1000th fraction of the 997th year of the 41st millennium. This is a notation used by the Administratum, rather than by common Imperial subjects. To and outsider or an apprentice ink-well filler this system may perhaps seem counter-intuitive, but I assure you that the greatest minds of the the Administratum have determined this to be the most effective way of recording dates on the scale of the Galaxy. This can also be written with the full stops removed: 138997M41.
The other number mentioned is the check number. Because of the vagaries of warp travel and communication, it is very hard to synchronise dates across the Imperium. Here is the master-stroke of the Imperial dating system!
A 0 or 1 means that the event took place on the sacred soil of Holy Terra itself, or within the blessed (for its proximity to the Emperor) space of the Sol system. 2 means that someone present at the event in question had the great honour of being in psychic contact with one of those few pious souls allowed within that most wondrous of star systems. 3 means that someone was in contact with someone at level 2 -- and so at three degrees to the world that served as the cradle of Mankind, truly a greater privilege than even the most devout servant of the Emperor could hope for!
4, 5, and 6 follow the same pattern. 7, 8 and 9 are used when the exact date is unclear: 7 is used if the date can be determined (by the auspicious scribes of the Administratum, who toil loyally all their days for the glory of the Emperor) to be accurate to within 10 years. 8 is used if the date can be determined to be accurate within 20 years. For anything where the accuracy cannot be determined a 9 is used -- this is mostly utilised by those poor, benighted people on the fringes of Imperial space who do not use the Administratum's dating scheme.
I beg of all those reading this to take a moment to pray for the inhabitants of those worlds, that their souls might be saved. Though it may seem a minor quibble to some, it is the case that any deviation from the imperial creed leaves space for the foes of Mankind to whisper their heretical and seditious lies.
The example given in your question -- 4.105.999.M41 , which could also be written 4105999M41 -- refers to some event that took place on the 105th fraction of the 999th year of the 41st millennium, and that those recording the events were in contact with the central Administratum of the most Holy Terra at the fourth degree.
I trust that you have found this missive instructive.
Your loyal servant,
Scholar Malum Pulmenti.
THOUGHT FOR THE DAY: THE REWARDS OF TOLERANCE ARE TREACHERY AND BETRAYAL.