20th-level cleric spellcasting is optimal
You may not want 20 levels of the cleric base class. You absolutely want to cast as a 20th-level cleric does, however. That means no other base classes, and only prestige classes that offer “+1 level of existing (divine) spellcasting class” at every level that you take.
Aside from spellcasting, cleric level only affects your ability to Turn or Rebuke Undead, and potentially the power of domain granted abilities. If you pick domains that don’t care and aren’t interested in controlling an army of undead with Rebuke, those don’t matter much to you.
But even if those aren’t important to you, cleric spellcasting is so good that it’s (much) better to just keep taking cleric levels than it is to miss out on cleric spellcasting. For example, in core, you probably want Cleric 20 just because your options for prestige classes are fairly lackluster (loremaster does advance your spellcasting, but the entry requirements are very steep).
So there’s no solid level for when cleric as a class stops being a good choice. It is always a very good choice. It is possible that some prestige classes are better choices for you, but that depends on your feats and skills.
For a good run-down of what prestige classes are available to you, there’s a handbook for that. Probably also worth taking a look at the general cleric handbook as well.
A single level of cleric works surprisingly well
There are a lot of characters that you wouldn’t expect to want a level in cleric, who actually benefit from it dramatically. Even with insufficient Wisdom to actually cast any cleric spells, the domain granted abilities and the fuel for Divine feats are both exceedingly valuable, plus you can swap a domain for the corresponding Devotion feat (Complete Champion), for things like the excellent Travel Devotion (move-as-a-swift-action for the next minute, once per day plus once more for every two uses of Turn/Rebuke you burn on it). Cleric is thus probably the best single-level dip in the entire game, and there is actually an entire handbook devoted to just a single level of the class.
The biggest problem with your build is not Cleric 9, but rather Fighter 1. By level 10 you shouldn’t need a feat that badly, nor does its full BAB matter overly much at that particular level. Bone knight certainly requires neither. Thus, Cleric 10/Bone Knight 10 is better. There may be even-better options to replace some of those cleric levels, though.