Creating unique constraint to be validated from input
This can be achieved by using a unique index on the combination of counter and the month of date_booked. Something like this:

create unique index idx_tbl on tbl (counter, to_char(date_booked, 'yyyymm'));


However the above will fail because to_char() is not an "immutable" function and thus cannot be used in an index (even if we know that the above is fine). The workaround for this is to create a wrapper function that is marked as immutable:

create function my_month(some_date date)
  returns varchar
  immutable 
  language sql
as  
$$
  select to_char(some_date, 'yyyymm')
$$
;


Then you can create an index using that function:

create unique index idx_tbl on tbl (counter, my_month(date_booked));


If you now insert the fourth row, you get the error:

duplicate key value violates unique constraint "idx_tbl"


If the table is big, you might want to use a number instead of a varchar in order to reduce the size of the index as well e.g. by using to_number(to_char(some_date, 'yyyymm'))