ANSWER: One can make a good case that it is best to get married when a person is in the mid-20s, above the typical college age, but before one is 30 years old. The advantage of being wed before (say) one is 40 or older is that younger people are less set in their ways. They are more likely to be somewhat flexible in their lifestyle compared to people who have lived for decades as a single person who then weds for the first time when they are (say) 40 or 45 years old.
People can face another issue if they wait until they are in their middle aged to be married for the first time. Many appealing members of the opposite sex are wed before they reach the ages of 30 or 35. Those who have been single their entire life, then choose to enter into matrimony after they are 40, are often faced with a pool of people who have wed at least once. Children, spouses or both who still exist from previous relationships can often add a degree of complexity and difficulty (as well as financial responsibilities in the case of child support payments) that a person who will be married for the first time may be ill prepared for.
A couple should aim to be in reasonably good financial shape before having children, such as by having finished college or trade school and having started a good career path. The first year out of high school (i.e., 18 - 19 years old) is very helpful in maturing many people. It is especially unwise to marry before then, especially for men. If both the man and the woman are teens, then the problems they encounter can be multiplied. Many teenagers have not developed enough socially, psychologically, and emotionally to handle all the responsibilities and burdens of matrimony, including child rearing, when they are 18 years old or younger. Ideally, one should try to get married between the ages of 24 and 30.
Now, let us tackle your second question concerning the difference in age between a husband and a wife. Scripture does not state a rule on this issue, although it highly suggests that Boaz was quite a bit older than Ruth, who had been married before, but had been widowed (Ruth 3:10). A Jewish tradition in the Midrash says Boaz was 80 and Ruth 40 at the time they became husband and wife. One factor that matters is whether the couple wishes to have children. A man can father a child even when he is old but many women may have trouble bearing children after 40 (although modern medical science easies this burden compared to the past).
Sometimes the impact of an age difference depends on whether a woman wants to have a "father figure" for a husband or wants an equal relationship. There are, of course, many cases of older women marrying notably younger men but that, even today, is a bit rarer. Inevitably, an older man will exert more authority over a notably younger wife, on average, because he is more experienced in life.
Any age difference becomes less important when both the man and woman are older. Ten years can be a significant issue if, for example, a man is 28 and the wife is 18 but a much smaller one if the husband is 50 and the wife is 40. Although scripture seems silent concerning an acceptable gap of years for a man and woman who chooses to be married, the question is whether it is wise to have a large gap. Couples with a large gap can easily possess different expectations and assumptions in life that can lead to conflict or boredom if they do not have enough in common mentally and socially.