In the context of a patent application, an invention is considered novel when it is different from all previous inventions (called "prior art") in one or more of its constituent elements. When deciding whether an invention is novel, the USPTO will consider all prior art that existed as of the date the inventor files a patent application on the invention.
An invention will flunk the novelty test if it was described in a published document or put to public use prior to the date the patent application was filed. The only exception is if the actual inventor-applicant created the publication and it was made up to one year before the filing date, it will not bar the application. However it is still unwise for an inventor to publish before filing since they will lose their foreign filing rights and another person may see the publication and file their own application on it before the true inventor files, thus requiring an expensive and uncertain derivation proceeding.