You question is a little vauge and light on details, but here are a list of assumptions. The string is massless, the plane is frictionless, and the pully has no torque. If all of these are true then you should be able to draw a force diagram for each block

So the net force is given by

Solving for the net acceleration gives (steps not shown)

Now with the acceleration above and the initial velocity and the initial positiion

Use the kinematic equation

to solve for the time