The epoch timestamp of right now is
now=$(date '+%s')
That of the next hour is
next=$(date -d $(date -d 'next hour' '+%H:00:00') '+%s')
The number of seconds until the next hour is
echo $(( next - now ))
For a continuous solution, use functions:
now() { date +%s; }
next() { date -d $(date -d "next ${1- hour}" '+%H:00:00') '+%s'; }
And now you have
echo $(( $(next) - $(now) ))
and even
echo $(( $(next day) - $(now) ))
Another way
Another slightly mathier approach still uses the epoch timestamp. We know it started on an hour, so the timestamp mod 3600 only equals zero on the hour. Thus
$(( $(date +%s) % 3600 ))
is the number of seconds since the last hour, and
$(( 3600 - $(date +%s) % 3600 ))
is the number of seconds until the next.