Q:

Does each and every subdirectory require its own ssl certificate? 

We plan to have an X.509 certificate for our web server which is running multiple independent web applications.  Those web applications are running on the same web server but are not related to each other (accessed by www.maindomain.com/sub1, /sub2 and so on).  If we have a certificate issued for the main domain, in order to secure each web application using TLS, do we still need a certificate for each and every web application? 

A:

No.  The sub folders (not sub-domains as mentioned) are all protected by the cert at the main level. 
It gets interesting if your applications were deployed as actual subdomains like "sub1.maindomain.com", "sub2.maindomain.com", etc.  You'd either need a wildcard cert or subject alternate names (SANs) on them.