how to get column count in postgreSQL
Add a COUNT() column:

select emp_id,
  sum(case when leave_type = 'Planned' then 1 else 0 end) Planned,
  sum(case when leave_type = 'Not Informed' then 1 else 0 end) NotInformed,
  sum(case when leave_type = 'Informed' then 1 else 0 end) Informed,
  count(*) as Total
from t
where activity_type='Leave'
group by emp_id;




emp_id | planned | notinformed | informed | total
-----: | ------: | ----------: | -------: | ----:
   619 |       2 |           1 |        1 |     4
   567 |       0 |           3 |        0 |     3



db&lt;>fiddle here