It's up to you. When you add it before baking, it settles into the cookie nicely, and doesn't tend to fall out, and it just becomes part of a whole. However, you could add it in once the cookie has cooled, too. If you add it in just after taking the cookies out of the oven, it will thin out the jam and possibly make it a little runny. I really only recommend adding your filling after you bake them when opting to pop a chocolate kiss on them as their center.