Mandarin is a very flexible language, I don't think word order will be too much trouble for you. 今天,昨天,后天,今年,后年,明年,今年,每天, can actually be placed *before* or *after* the subject of the sentence: 昨天我买了一袋苹果 and我昨天买了一袋苹果 both mean "I bought a bag of apples yesterday". They are both grammatically correct.
However, in the sentence:
今天几月几号?-What is today's date? 今天 is placed in the beginning, since its the subject, and followed by the month and the date(Chinese has the concept of big to small[i.e. year-month-date-day of the week])So in this case, the word order can't be changed.
两个小时 is not the same case, since a duration of time. It really depends on the sentence. i.e. "it takes two hours to get there:" 到那里要两个小时,
到- to arrive, 那里-there,要(to be going) is followed by 两个小时(two hours)
"I ate two hours ago" would be 我两个小时前吃了饭
As you can see 两个小时 is placed in different parts of the sentences. In the first example, the sentence structure is as follows: 要+the time you are talking about. So "it takes two hours" would be: 要两个小时。
For the next example, 前(before) and 后(after) is placed after the event as opposed to English where we would say "*before* I have a meal" or "*after* I have a meal" in Chinese its the opposite: 我吃饭前,我吃饭后. Like in the sentence where there are two events, i.e "I want to go swimming *after I finish school*" in Chinese *after I finish school* goes in the beginning, you would say: 我想放学后去游泳: which means: I want *after finish school* go swimming(literally) Basically, the last event comes first, then 后or 前 followed by the first event(kind of confusing, right?) This is the same in your case, 两个小时前 would come before "ate" so: 我两个小时前吃了饭 - I ate two hours ago.
I hope this clears any confusion. If you still need more help you can message me, most questions like these require a full explanation, but unfortunately there is a character limit.