PostgreSQL sort by max date and get the difference
If there is exactly one maximum balance per month, the first query can be simplified to 

select balance 
from balances 
where user_id = 123 
  and date_trunc('month', datecreated) = date '2018-08-01'
order by datecreated desc 
limit 1;


The difference between a specific month and the previous one, can be calculated with a window function:

select b.datecreated, 
       b.balance,
       coalesce(prev.balance, 0) as prev_balance
from balances b
  left join lateral (
    select balance 
    from balances b2
    where b2.user_id = b.user_id
      and b2.datecreated &lt; date_trunc('month', b.datecreated)
    order by datecreated desc 
    limit 1
  ) as prev on true
where user_id = 123 
  and date_trunc('month', datecreated) = date '2018-08-01'
order by datecreated desc 
limit 1;


Online example: https://rextester.com/WGTPBO61473