Prof. Semenov's has given a complete characterization of the class of spaces your are interested in: These are the topological vector spaces, for which every continuous linear functional is continuous. A tautological example of such a space is given by any infinite-dimensional vector space together with the weak topology with respect to all linear functionals in the algebraic sense. However, such a space has necessarily bizarre properties: For most of the infinite-dimensional topological vector spaces that one studies in functional analysis there do exist discontinuous linear functionals. Assuming ZFC one e.g. finds discontinuous linear functionals on all Banach spaces, but the same conclusion holds actually in much larger generality: See https://en.wikipedia.org/wiki/Discontinuous_linear_map for a general discussion and references. The informal upshot is: All of the standard examples of infinite-dimensional topological vector spaces do not have the property you want. One can artificially manufacture such examples, but they are necessarily rather weird.
I could be wrong but it follows (since trivial subspace {0} is closed) that all such TVS should be T1-spaces (moreover, regular and Hausdorff). In addition, such TVS are exactly the TVS V with the following property: each subspace L of V of codim L=1 (each hyperplane) is closed. Due to Exercise 9.4 (Chapter 9) of the book: Francois Treves, "Topological vector spaces, distributions and kernels ", it is equivalent to the condition that each linear functional on V is continuous.
Prof. Semenov's has given a complete characterization of the class of spaces your are interested in: These are the topological vector spaces, for which every continuous linear functional is continuous. A tautological example of such a space is given by any infinite-dimensional vector space together with the weak topology with respect to all linear functionals in the algebraic sense. However, such a space has necessarily bizarre properties: For most of the infinite-dimensional topological vector spaces that one studies in functional analysis there do exist discontinuous linear functionals. Assuming ZFC one e.g. finds discontinuous linear functionals on all Banach spaces, but the same conclusion holds actually in much larger generality: See https://en.wikipedia.org/wiki/Discontinuous_linear_map for a general discussion and references. The informal upshot is: All of the standard examples of infinite-dimensional topological vector spaces do not have the property you want. One can artificially manufacture such examples, but they are necessarily rather weird.
Actually, every infinite dimensional vector space E can be equipped with so many, even a locally convex, topologies so that every subspace is closed. Any one compatible with the duality (E, E*), E* being the algebraic dual of E.
I would add that one of these, namely the strongest locally convex topology (SLCT), can actually be quite useful in convex analysis, calculus and optimization (for example, to re-derive algebraic results from their topological versions). Such technical uses of the SLCT are routine: see, e.g., the texts of Kutateladze (Fund. Funct. An., 1983-1996), Levin (Conv. An., 1985 in Russian) and Tiel (Conv. An., 1984), and also Sec. 7.2 in the monograph Horsley-Wrobel (2016)="The short-run approach to long-run equilibrium in competitive markets" (LNs Econ. Math. Sys. 684, Springer).