The short answer is "Both".
Tomcat is a
servlet container that can also be run as a standalone webserver.
The distinctions between these terms is a bit blurry but here is
a rough description.
Appserver: Java term for an application that runs J2EE applications. This includes EJB, Servlets, JNDI,
JSP, and more..
Servlet Container: The part of an appserver that handles Servlets (most have JSP compilers built in With some, you have to pay more for this).Webserver: An application running on a machine that handles HTTP requests. Originally, these only handled static files and maybe CGI scripts.
Tomcat can either be bound to an external webserver (such as Apache HTTPD or Microsoft IIS) but can also run as a stand-alone Webserver/Servlet container/JSP engine. It can also be embedded into a full Appserver such as
JBoss.