To elaborate a little bit on @SamBC's answer:
The teacher remarked how quickly the students were learning.
This is the less ambiguous version. You could replace the word "remarked" with any other speech verb — "said", "exclaimed" — and pretty much preserve the meaning of the sentence. There's a strong implication that the teacher's remark was exactly "How quickly you're learning!" The students are probably learning quite quickly.
The use of the verb "remarked" (as opposed to "said") connotes that the students' rate of learning is moderately surprising to the teacher. Their rate of learning is remarkable (for some reason).
The teacher remarked on how quickly the students were learning.
The teacher went out of her way to make a remark on the students' rate of learning. (In this context, the word "on" means "concerning" or "regarding".) We don't know what the remark was. Maybe it was "How quickly you're learning!", or maybe it was "You're learning at an unfortunately rapid pace and soon I'm going to run out of prepared class materials," or maybe it was "You're not learning as quickly as I'd hoped." Again, though, we can be sure that there is something remarkable concerning the students' rate of learning.
The fact that this is a teacher also raises the possibility of a pun. I don't think it's relevant here, but consider if the two sentences were:
The teacher remarked on the students' papers.
The teacher remarked the students' papers.
Here the first sentence, as usual, means that the teacher made a remark regarding the students' papers. But the second sentence should clearly be understood to mean that the teacher gave new marks to the students' papers: she'd already marked them once, but now she was re-marking them.