While often used interchangeably in reference to the same product, there is in fact a difference between jelly and jam. Both jelly and jam (and preserves and marmalade) are made by cooking fruit and sugar until they become the consistency of a sauce. The difference is what happens after that.
Jelly is made of only the fruit juice and sugar. Once the fruit and sugar are cooked, the juice is strained to create the jelly. Given the lack of pieces of fruit in the jelly, it’s typically quite clear.
Jam, on the other hand, keeps it all and contains the smashed or boiled down fruit as well. Given that the fruit stays in the preserves, some larger fruit should be chopped before cooking. Smaller, more delicate fruit like raspberries will naturally fall apart when cooked. Also, the color of jam is a little darker - not quite clear and not solid.
When it comes to baking, I recommend using jam in your thumbprint cookies, bars, and pastries because it adds a little richer flavor and texture to the final product.
If you’re making jelly or jam from scratch, you might want to add pectin. Pectin is a type of starch that is found in the cell walls of fruits and vegetables, and is what makes your jelly or jam gel and hold their texture when they cool. Some fruits contain more pectin than others, so there is pectin available to purchase to add in and get your jelly or jam to be the firm, yet spreadable, texture you want.
Like Glen Miller said, “It must be jelly, cuz jam don’t shake like that.”