Consider an arbitrary solution: it will use $H$ horizontal lines, $V$ vertical lines, and $S$ skew lines (that are neither vertical nor horizontal).
If $H=7$, then we need at least $6$ lines to connect these horizontal lines to each other. Hence $H+V+S\ge13$ in this case.
If $V=7$, we argue symmetrically to case 1.
If $H=6$, there exist $7$ points (on another horizontal line) that are NOT covered by the horizontal lines in the solution. Each of these $7$ points must be covered by a separate line; this yields $V+S\ge7$ and $H+V+S\ge13$.
If $V=6$, we argue symmetrically to case 3.
It remains to consider the case with $H\le5$ and $V\le5$. Consider the remaining $(7-H)(7-V)$ points that are not covered by any horizontal or vertical line. They form a grid, and the boundary of this grid contains $24-2(H+V)$ points. As each of the skew lines covers at most $2$ of these boundary points, we conclude $S\ge 12-(H+V)$. This is equivalent to $H+V+S\ge12$.
Summarizing, in each of the five cases we needed $H+V+S\ge12$ lines.
The argument generalizes to $n\times n$ grids and yields a lower bound of $2n-1$ for $n\le2$ and a lower bound of $2n-2$ for $n\ge3$. These lower bounds are actually best possible, as one easily constructs solutions with at most $2n-2$ lines for $n\ge3$ (just keep extending the spiral in the above answer for $n=7$; whenever $n$ increases by $1$, we attach $2$ further segments to the spiral).
Hence the complete answer to the problem is as follows.
If $n=1$ or $n=2$, the best solution uses $2n-1$ lines.
If $n\ge3$, the best solution uses $2n-2$ lines.