When speaking of famous persons, like Albert Einstein and Thomas Alva Edison, it´s fine to just use their last names.
In a formal setting, as when greeting a teacher as a student, you would use the prefix Mr./Mrs./Ms. and their last name.
In an informal setting like on the internet, or with people you know fairly well, it´s common to use their first names.
PS
It differs from country to country, and I believe that it´s more common to greet your teacher with mr. lastname in the UK, than in the US, as they generally have a more polite language.