According to the docs, at https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_gov_limits.htm :
CPU time is calculated for all executions on the Salesforce
application servers occurring in one Apex transaction—for the
executing Apex code, and any processes that are called from this code,
such as package code and workflows. CPU time is private for a
transaction and is isolated from other transactions. Operations that
don’t consume application server CPU time aren’t counted toward CPU
time. For example, the portion of execution time spent in the database
for DML, SOQL, and SOSL isn’t counted, nor is waiting time for Apex
In your case, the workflow rule would count against CPU time if it was triggered from Apex code (so if you carried out the lead/case assignment via Apex code). If not, then only the time spent in the custom controller itself would count against the CPU time limit. If you want to know more about this limit, check out Josh Kaplan's blog post on the subject.
The SOQL queries will always count, as they are based on all of queries executed in a single transaction, regardless of where they are executed from.