Does my visit have to end when my visitor visa expires? Or can I stay 6 months?

My visitor visa to Canada expires on 11th August 2019. If I arrive in April 2019 can I stay for six months, or do I have to leave before my visa expires?