I have a 2 BR apartment which I have been using to sublet to tenants for several years. I don't put them on my lease. Is this illegal, and if so, what are the penalties?
A breach of a legal agreement (such as a lease agreement) is indeed illegal. This is generally handled by civil law, not criminal law. Likely, the lease agreement states that your lease can be terminated if you violate the agreement. You may also be liable for monetary damages.
You will want to read your lease agreement carefully. It will specify what happens if you violate it.