If you find the correct flag for a hacking challenge, you get the full amount of points for the challenge. Hacking challenge points are all or nothing.
Coding challenges each have a max score, which is listed on the challenge:
Most coding challenges have hints, and each hint takes a set number of points away from your score:
Additionally, points are also taken away based on the number of failed submissions.