You should charge your MacBook Pro using the official charging cable that came with the computer, and turn it off for an optimal charge.
If your Macbook isn't charging, there are several ways you can troubleshoot to get the computer to accept a charge.