Overnight means during the night. Stay overnight, an overnight train, leave it overnight.
As an adjective it goes before the noun: an overnight bag, an overnight stay. The second sense is very suddenly, as if it happened while everybody slept: an overnight success, prices doubled overnight. That sense is nearly always an exaggeration, and an overnight success is usually the result of about ten years of work. Note overnighter, an informal word for a stay of one night.
1adverbovernightDuring the night.
“Leave the dough overnight and it doubles.”
2adverbsuddenlyVery suddenly.
“Nothing changes overnight, whatever the papers say.”
3adjectivelastingLasting or happening through the night.
“We took the overnight ferry and woke up in Spain.”
Too few real examples of this word to estimate which sense is commonest.
overnight is a span of time, or a suddenness.
Old English ofer niht meant simply through the night. The suddenness sense is nineteenth-century and comes from the experience of waking to find the world changed — which is a fair description of how change is noticed.
German
übernachten
Old English
ofer niht — through the night, overnight
Middle English
overnyght
English, today
overnight
Inherited from Middle English overnyght, from Old English ofer niht (“through the night, overnight”), equivalent to over + night. Verbal use (late 19th c.) may have been influenced by German übernachten (16th c.), though it could also have developed independently. Compare also Dutch overnachten (“to overnight”), Middle Low German ȫvernachten (“to overnight”), West Frisian oernachtsje (“to overnight”), stq uurnoachtje (“to overnight”).
Etymology from Wiktionary, CC BY-SA