When can you have a lawyer?

In the US, the constitution's right to counsel means that you can always have a lawyer.

However, there are only certain times where the government has to provide one for you if you can't afford it.