In general, $\operatorname{Spec} \mathcal{O}_{X,p}$ cannot be viewed as an open, closed, or locally closed subscheme of $X$. Consider $X=\Bbb A^1_k$ for a field $k$: then $\operatorname{Spec} \mathcal{O}_{X,p}$ is either the generic point, or a single closed point and the generic point topologized so that the only nontrivial open set consists of the generic point. Neither set is open nor closed in $X$, so $\operatorname{Spec} \mathcal{O}_{X,p}$ cannot be an open or closed subscheme of $X$. To see it is not a locally closed subscheme, we note that the closed points are dense in any locally closed subset of a scheme of finite type over a field, in contrast to the two spaces we found above.