A servlet is solely a class which response to a distinct type of network request - most generally an HTTP request. Servlets are usually used to perform web applications - but various frameworks serve on top of servlets (e.g. Struts) to give a higher-level concept than the "here's an HTTP request, write to this HTTP reply" level which servlets provide.
Servlets run in a servlet container that controls the networking side (e.g. parsing an HTTP request, connection handling, etc). One of the best-known open-source servlet packages is Tomcat.