The year in the copyright notice refers to the year of first publication. Nowadays copyright notices and the year in the copyright notice are no longer very important, since copyright starts automatically when a creative work is created, and typically extends for a variable amount of time unrelated to the date of publication. This wasn't always the case. Especially, U.S. copyright law changed dramatically during the 20th century, and did require copyright notices in specific formats for a long time.
Though not required by law, there's no good reason to omit these notices either since they serve as a clear record of authorship. In particular, they serve as a reminder that the work is under copyright protection and therefore deter copyright infringement.
Many licenses do require such a copyright notice. And if there is a notice, it should be kept up to date (as discussed below). In particular, you must not remove or falsify any existing notices. Additionally, many licenses require preservation of existing notices.
In the case of open source projects, the year in the copyright notice should be updated only when a new version for the project is first published. Publication isn't just the release of a version, but e.g. also pushing a commit to a publicly visible version control repository. It would be misleading to automatically update the copyright notice each year, unless there actually are new changes that are relevant for the purpose of copyright.
It is a common convention that the notice lists all years where new versions were published. This reflects that different parts of the project were published at different times. Since the list of years can get rather long, it is common to collapse consecutive years to a range: “2016, 2017, 2018” is often written as “2016–2018”. If in doubt, always use the most recent year. So “2018” would also be correct.
The other reason to update these notices is if there are new authors. Typically, this is done by adding a new copyright line for each set of authors, with the most recent on top. For example:
Copyright 2016–2018 George
Copyright 1999, 2007–2016 Fred
Adding a new line is sensible since many open-source licenses require that existing copyright notices are kept intact – so you must not update them in any way. And in the above example, adding George to Fred's copyright notice would be misleading since George did not publish any of their work in 1999 and Fred didn't publish in 2018.
In practice, tracking all authors in all copyright notices is quite cumbersome. Instead, often only the original author is credited here even when copyright is shared with additional contributors. A more reasonable approach is to credit all authors collectively, e.g. as “the FooProject contributors” or “Original Author and others”. However, I am not sure whether that results in a valid copyright notice as the copyright holders must be clearly recognizable.