Are you talking about “peanut butter” and “Jelly” as modern, commercialized, factory-produced products? Or merely about the substances themselves?
Because if you’re just talking about pureed or mashed-up peanuts, almost certainly at some point since their domestication in prehistoric South America, it occurred to someone to mash them up and either eat them that way or utilize them as a spread on tortillas.
Jelly (and jam), as a substance composed of gelled, cooked fruit and/or fruit juice, relies on an abundant supply of refined cane sugar, which is what gives it its preservative properties. Abundant supplies of cane sugar first appeared in the Middle Ages, in the Middle Eastern countries, from whence it then spread to Europe via returning Crusaders.
So assuming that some Native American smooshed his peanuts before eating them, it would appear that peanut butter came first.
But if you’re talking about the modern industrialized products, there’s a discussion of it here. There’s a discussion of the history of jam and jelly here.