I was always taught growing up Catholic that church doctrine is constant and can never change, but where did this doctrine itself come from? Most other Christian churches I'm aware of allow more liberal development of doctrine, but for Catholics (and I suppose Orthodox), once something is dogmatically defined it is final. This idea doesn't seem to have come directly from Jesus either since it's not in the Gospels, so what is its origin?
Do you have a source for this idea? Or is it just something you got in your everyday life? Church doctrine and has indeed changed throughout the years, that is a purpose of church councils such as the Council of Trent.
The assumption is part of the name: catholicus literally means "universal", and therefore "orthodox," and the title was claimed by the Pope (and various other bits of the late antique Church) well before we might talk about a "Catholic Church" in the modern sense. Indeed, Gregory I's famous claim to be the servus servorum Dei (servant of the servants of God) was his way to reject the Patriarch of Constantinople's claim to be οικουμενικος (ecumenical, the Greek word for catholicus).
This idea is a bit in the Bible: Peter is the rock on which the Church is built (Mt. 16:18). In other words, the idea of the existence of a fixed truth (but not the existence of a Church which represents that truth in all aspects) is from scripture.