Which reaction occurs first when 5-hexen-1-ol reacts with sulfuric acid?
In general, intramolecular reactions occur faster than their intermolecular counterparts. Most commonly this is rationalized by an entropic argument: in the case of the intermolecular reaction, two molecules (substrate + water) combine to form one (diol). This is entropically disfavored relative to the intramolecular case, in which the molecule cyclizes.

However, the biggest factor at play in determining which will occur in this case is the size of the resulting ring. If the product contains a 5, 6, or 7-membered ring, these rings are considered be unstrained (bond angles ~ 109.5 degrees). If the rings are smaller than 5 atoms or larger than 8, the rule of thumb is that the thermodynamic (enthalpic) cost of the ring strain associated with cyclization overcomes the entropic driving force to cyclize, and the intermolecular reaction is preferred.