Any planar, respectively, outerplanar graph $G=(V,E)$ satisfies $|E'|\le 3|V'|-6$,respectively, $|E'|\le 2|V'|-3$, for every subgraph $G'=(V',E')$ of $G$.Also, (outer-)planar graphs can be recognized in polynomial time.What is known about graphs $G=(V,E)$ such that $|E'|\le 3|V'|-6$(resp. $|E'|\le 2|V'|-3$) for every subgraph $G'=(V',E')$ of $G$? Is it possible torecognize them in polynomial time?Edit (after Eppstein's nice answer): Any planar graph $G=(V,E)$ satisfies $|E'|\le 3|V'|-6$ for every subgraph $G'=(V',E')$ of $G$ with at least three vertices $|V'|\ge 3$. So, generalized planar graphs would be those satisfying this property, and recognizing them in polynomial time seems to be an (interesting) open question. 
About generalized planar graphs and generalized outerplanar graphs
reference request;graph theory;graph algorithms
In the notation of Lee and Streinu (citation below) the second class you list are the (2,3)-sparse graphs. They give an algorithm to test whether a graph is (k,l)-sparse in polynomial time. However, the situation with planar graphs and $|E'|\le 3|V'|-6$ is a little more complicated, because that inequality is not true for all sets of vertices (if it were true, no two vertices could be connected by an edge, because $3\cdot 2-6=0$). So the class of (3,6)-sparse graphs (in their notation) consists only of empty graphs.  Probably their algorithms can be extended to graphs for which the inequality holds for all sets of more than two vertices.Lee, Audrey; Streinu, Ileana (2008), Pebble game algorithms and sparse graphs, Discrete Mathematics 308 (8): 14251437, doi:10.1016/j.disc.2007.07.104, arxiv:math/0702129.