The line is pretty arbitrary.>A distinction is often made between erotica and pornography, although some viewers may not distinguish between them. A key distinction, some have argued, is that pornography's objective is the graphic depiction of sexually explicit scenes. At the same time, erotica "seeks to tell a story that involves sexual themes" that include a more plausible depiction of human sexuality than in pornography.
Even what you call hentai is often really more erotica than pornography: it's got defined characters and plot and everything. In fact in Japanese they are called eroanime and eromanga - not pornography.
Pornography would be, say, single-image sexual fanart and stuff like that.
Now, your original question was about ecchi versus hentai, not erotical versus pornography. That makes it even trickier, because those are highly vague terms invented by fans for fans, with no official backing. So really, if you call it hentai it's hentai, if you call it ecchi it's ecchi.