When you pass a quoted string to solve(), existing variables are not used (not unless they were defined within the MuPAD environment, which is not the case for your code).
You should pass in symbolic expressions instead.
syms t
vel=100;
theta=50;
height=150;
v_vert=vel*sind(theta); %Y-velocity (m/s)
g=9.81; %gravity constant (m/s^2)
y_f=-height;
time = solve(y_f == v_vert*t-g/2*t^2, t)
Note: if you are using a version of MATLAB that is a couple of years older, it might complain about the == being unable to compare symbolic objects. If that happens, then use the usual trick:
solve( A == B )
is the same as
solve( (A) - (B) )