categorical_crossentropy lets you use the actual label values. It’s good for when you have a single category, or you have an input that can fit into multiple classes so one-hot encoding your label won’t help (for example, an image with multiple goats).
sparse_categorical_crossentropy lets you use the index of your class as the label and creates the one-hot array for you. This helps when you have lots of classes and don’t want to have your label be a huge array of 0s with one 1 for the class that you’re looking for.