Sorry if this is too long! I think it's different to previous questions...
In 'King's Cross', Dumbledore claims that James had showed him the cloak "just a few days previously" to the attack on Godric's Hollow (31st October, 1981), indicating he only possessed it for the purpose of examining it for a few days.
You. You have guessed, I know, why the Cloak was in my possession on the night your parents died. James had showed it to me just a few days previously. It explained much of his undetected wrongdoing at school! I could hardly believe what I was seeing. I asked to borrow it, to examine it.
Harry Potter and the Deathly Hallows - Chapter 35: King's Cross
However, from Lily's letter to Sirius we see that this cannot be possible, since Dumbledore clearly had the cloak from around Harry's birthday, 31st July. Note that this letter was written as a thank you letter for the present Sirius got Harry for his birthday.
Dear Padfoot, Thank you, thank you, for Harry’s birthday present! It was his favorite by far [...] We had a very quiet birthday tea, just us and old Bathilda who has always been sweet to us and who dotes on Harry. We were so sorry you couldn’t come, but the Order’s got to come first, and Harry’s not old enough to know it’s his birthday anyway! James is getting a bit frustrated shut up here, he tries not to show it but I can tell—also Dumbledore’s still got his Invisibility Cloak, so no chance of little excursions.
Harry Potter and the Deathly Hallows - Chapter 10: Kreacher's Tale
Even allowing for a few days of response time after a birthday for a 'thank you' letter, it seems to me that there is very little chance of Lily having written this later than early August, following Harry's birthday. Dumbledore still had the cloak when the Potters were killed (31st October) and so this leaves a gap of almost three months when Dumbledore must have had the cloak, not the "just a few days previously" he claims at King's Cross. This is rather a long time to "borrow" something so precious!
First I thought he was feeling guilty for having deprived the Potters of a powerful magical object in a time of great peril, but in response to Dumbledore's statement earlier, Harry attempts to reassure him:
"The Cloak wouldn’t have helped them survive, though," Harry said quickly. "Voldemort knew where my mum and dad were. The Cloak couldn’t have made them curse-proof."
"True," sighed Dumbledore. "True."
Harry Potter and the Deathly Hallows - Chapter 35: King's Cross
The best theory I have come across thus far is that Dumbledore was ashamed of his obsession with the Hallows and so lied to Harry about how long he had the cloak.
http://dlewis.net/blog/2017/04/11/harry-potter-and-the-problem-with-the-pensieve-memories/ - (the relevant material starts Theory 3 - Part 1 Dumbledore's lie).
However, I do not find this entirely convincing, as Dumbledore is seemingly at his lowest point of self-loathing here and has very little to gain from lying - he is trying to get Harry to despise him:
"You cannot despise me more than I despise myself.” “But I don’t despise you —” “Then you should,” said Dumbledore.
Harry Potter and the Deathly Hallows - Chapter 35: King's Cross
Do you believe the summarised theory presented in the blog I linked or do you find it more credible that Lily wrote the letter just before Halloween? It seems unlikely the Potters would be struggling to communicate with the outside world, given that they had contact with other people (Bathilda and Wormtail) during that time, so sending an owl to Sirius is unlikely to have been so difficult as to take three months to achieve. (I also do not believe they would have intentionally delayed replying so long to thank someone for a birthday present!)
My only other theory is that Rowling simply made a mistake, which I think I tend towards, but it seems so obvious an oversight!
TL;DR Dumbledore's statement about when he has the cloak contradicts the approximate date in Lily's letter when she states Dumbledore takes the cloak - is he lying (and why?) or is this just JKR oversight?