How to calculate column (integer) changes in hourly buckets?
This query is for all the buckets.

with points_enhanced as( -- Add date_id for grouping and ordering, hour for displaying
  select to_char(created_at, 'YYYYMMDDHH24') date_id, extract (hour from created_at) as hour, * from public.points 
)
, points_with_lag as ( -- Calcuate lag point by user_id
  select date_id, user_id, hour, points, 
    lag(points, 1, 0 ) over w points_before
  from points_enhanced pe
  window w as (partition by user_id order by date_id)
)
, cte_buckets as ( -- What if we have more than one record by bucket and user_id ? Use only max(points) and min(points_before)
  select date_id, hour, user_id, max(points)  - min(points_before) points_bucket 
  from points_with_lag
  group by date_id, hour, user_id
)

select date_id, hour, sum (points_bucket) points
from cte_buckets
group by date_id, hour
order by date_id


This query is for min_date / max_date filter.
Adjust the dates to your needs.

with points_enhanced as( -- Add date_id for grouping and ordering, hour for displaying
  select to_char(created_at, 'YYYYMMDDHH24') date_id, extract (hour from created_at) as hour, * from public.points 
  where created_at &gt;= '2017-05-30 12:00:00' and created_at &lt; '2017-05-30 14:00:00' -- filter by min_date/max_date
)
, points_with_lag as ( -- Calcuate lag point by user_id
  select date_id, user_id, hour, points, 
    lag(points, 1, 
                 ( select coalesce(max(points), 0) from public.points p -- This correlated subquery gets the lag point value, or 0, for that user_id before the min_date limit
                   where created_at &lt; '2017-05-30 12:00:00'
                   and p.user_id = pe.user_id
                 ) 
    ) over w points_before
  from points_enhanced pe
  window w as (partition by user_id order by date_id)
)
, cte_buckets as ( -- What if we have more than one record by bucket and user_id ? Use only max(points) and min(points_before)
  select date_id, hour, user_id, max(points)  - min(points_before) points_bucket 
  from points_with_lag
  group by date_id, hour, user_id
)

select date_id, hour, sum (points_bucket) points
from cte_buckets
group by date_id, hour
order by date_id


Regards.