I think a person should get married when they are old enough to know what they want in a mate and a marriage. They should be of an age where they know they share similar values and beliefs with their potential spouse. They also know how they like to have fun together. Do they like to cook together? Do they like to travel together?
If you want to look to science for an answer, you could read a book called “Algorithms to Live By: The Computer Science of Human Decisions.” This book says the perfect age to get married is 26