ls -l --time-style=long-iso | grep -c ' 2017-'
Replace 2017 with whatever 4 digit year you want. The
--time-style option will cause ls to print ISO 8601 timestamps instead of the short, vague human readable stuff it does by default. The expression passed to grep will then match the year at the beginning of the timestamp, and should just pull out the lines for the files that were modified that year (providing you have no filenames that start with those four digits followed by a dash).
Note that this will likely only work with the GNU implementation of
ls (I know for a fact it doesn't work with the busybox, FreeBSD, NetBSD, or MINIX implementations, and I'm pretty sure it doesn't work with the Solaris one either).
As requested in the comments, the following (long and convoluted) command can be used to get the number of individual years represented:
ls -l --time-style=long-iso | tail +2 | sed -n 's/ */ /gp' - | cut -d ' ' -f 6 | cut -d '-' -f 1 | sort -u | wc -l
The tail command strips off the first (useless) line showing totals. The sed command collapses runs of spaces to single spaces. The first cut command pulls out the year-month-day field, the second pulls just the year out of that, which the sort command then reduces to one instance of each year, and the wc command finally spits out the number.