It's a nominalized adjective (similar to forms мороженое, жаркое etc.) derived from the CS word запѧти (to stop). So запятая means "stopped".
Most probably, it modified the word боукы (буква in modern Russian, meaning "letter").
The Russian word препинание (as in знаки препинания, "punctuation") derives from the same root.
Unlike most CS and Russian linguistic terms, it's not a calque from a Latin or Greek term, which means itthe term appeared very early (late XV or early XVI). Zizany and Smotritsky both mention it in their grammars.