query two point values from a table then insert a new record after creating a line from the two points
You have to put the literal strings in the right spot.  You have them as part of the FROM clause, which doesn't make sense.  Put them in the select-list.

insert into locations (geom,type,label,user) select 
    st_makeline(a.geom,b.geom) as line, 'Link','test','ADMIN'
from (select * from locations where id = 144) as a, 
     (select * from locations where id = 145) as b;