Yes, you can place "by far" after the noun, but if you choose to do so it would be better not to include "in class." To say, "He is the most clever boy by far in class" is an unusual idiomatic construction. You could, however, place "by far" at the end of the sentence so that it would read, "He is the most clever boy in class, by far."
"Near in time" and "close in time," although both logically correct, are also both unidiomatic. If you are referring to something that is going to happen in the future, you could say, "in the not too distant future," or "will happen soon." If you are referring to something that happened in the past, you could say, "recently" or "not that long ago," etc.