“I did it in under seven hours.”
You took a long car trip to another city. Now you're talking about the trip to a friend who's driven to that city before. She asks if it took you 8 hours to get there, because that's how long it took her when she went. This is how your reply.
I did it in under seven hours.
When someone does something quickly, you say that they did it "in ___ hours" or "in ___ minutes", etc. For example:
I'll have dinner ready in ten minutes.
We designed and built the whole site in less than a week.
On the other hand, when something is not done quickly, you say that it "takes ___ hours to (do it)":
It took me over 9 hours to get there.
"Under" a number means "less than" that number. But "under" is used in certain specific situations:
You use "under" to show that something is below a limit:
They don't allow anyone under 18 to enter.
I was driving 10 miles under the speed limit.
You use "under" a number when you're emphasizing that the number you're comparing to is already low, like in the example at top. Some other examples:
We have DVDs on sale for under ten dollars.
They promise to deliver it in under 30 minutes.
The opposite of "under" is "over". The opposite of "less than" is "more than".