A grimoire is a book that is used to keep recipes, lore, spells, rituals, knowledge, and any other spiritual things that you want to keep track of. It can also be used as a form of journal, but is more like a magickal text book. The word grimoire can be applied to pretty much any magickal, spiritual, or religious texts though.
A book of shadows is a book that is used to keep track of certain spells, and rituals one has attempted, and keeps a documented record of them, so that they can be redone later. Books of Shadows are also usually more related to wicca, and witchcraft, and is more a personal magickal journal, and record of one’s practice, though it can be kept between a group of practitioners.
Books of Shadows are grimoires, but not all grimoires are books of shadows.