How long had Balin and the other Dwarves been slain before they were discovered by the Fellowship when they entered Moria?
According to the Tale of Years in Appendix B, Balin and the rest of the colony were killed in 2994. The Fellowship passed through Moria in January 3019, so roughly 25 years had passed. (Dates are Third Age.)
This is confirmed by the book of records Gandalf reads in Book II Chapter 5, The Bridge of Khazad-Dûm:
‘It seems to be a record of the fortunes of Balin’s folk,’ he said. ‘I guess that it began with their coming to Dimrill Dale nigh on thirty years ago: the pages seem to have numbers referring to the years after their arrival.’
The final pages of the book are numbered year five.