The problem is to find a line that passes through $p$ and has all the other points in $S$ on one side. This is a two-dimensional linear-programming problem, so it can be solved in $O(n)$ time using textbook geometric algorithms.
But let me describe a self-contained solution.
To simplify notation, translate all the points so that $p$ is the origin $(0,0)$, and let $Q = S\setminus\{p\}$. Then we want to determine if there is a real number $m$ such that either (1) $y < mx$ for all $(x,y)\in Q$ or (2) $y > mx$ for all $(x,y)\in Q$. In the first case, $p$ is a vertex of the upper hull of $S$; in the second case, $p$ is a vertex of the lower hull of $S$. I'll describe an algorithm for the first case; the other case is symmetric.
If any point in $Q$ lies directly above $p$ (that is, if any point in $Q$ has coordinates $(0,y)$ for some $y>0$), then $p$ cannot lie on the upper hull. It is easy to check this condition in $O(n)$ time.
So assume no points in $Q$ lie directly above $p$. The $y$-axis splits $Q$ into two subsets $L$ (left) and $R$ (right). Points in $L$ have negative $x$-coordinates, and points in $R$ has positive $x$-coordinates. (Points directly below $p$ don't matter; just ignore them.) Let
$$
m_L = \min_{(x,y)\in L} \frac{y}{x},
\quad
M_R = \max_{(x,y)\in R} \frac{y}{x},
\quad
\text{and}
\quad
m = \frac{m_L + M_R}{2}.
$$
Now there are three cases to consider:
If $m_L < M_R$, then every point in $Q$ lies strictly below the line $y = mx$, so $p$ is a vertex of the upper hull.
If $m_L = M_R$, then the line $y=mx$ passes through a point in $L$ and a point in $R$, and no point in $Q$ is strictly above that line. So $p$ lies on an edge of the upper hull, but it is not a vertex.
If $m_L > M_R$, then at least one point in $L$ and at least one point in $R$ lie strictly above the line $y=mx$. So $p$ lies strictly below the upper hull.
It is easy to compute $m_L$ and $M_R$ in $O(n)$ time. We don't actually need to compute $m$.