Start by determining the velocity of the pumpkin as a function of theta. From energy principles, $\displaystyle v^2 = \sqrt {2g \Delta h}$, where $\displaystyle \Delta h$ is the vertical height that the pumpkin descends: $\displaystyle \Delta h = R(1\cos \theta)$.
Next determine the radial acceleration of the pumpkin as a function of theta, based on $\displaystyle a_r = v^2/R$
Finally, recognize that the pumpkin loses contact when the radial acceleration exceeds the component of acceleration due to gravity (g) that operates in the radial direction, which is $\displaystyle g \cos \theta$.
Can you take it from here?
