Score (or Points) is the fundamental element in Candy Crush Saga. It is a stat that is calculated during and after a level. Score will vary every time you complete a level, and every level has a score requirement to pass.
However, many people tend to get the score requirement but fail to complete the required tasks (depending on the type of level). Timed and Moves levels are the only types of levels that only have a score requirement without completing other tasks, because score is the task in these levels.
Stars are obtained based on the score the player has at the end of the level. One is the minimum and is mandatory to pass the level, while three is the maximum.
In most jelly, ingredients and candy order levels, completing the objectives directly give the player the score required for one star. There are some notable exceptions such as level 169 and pre-nerfed levels 608 and 623 (which is a copy of pre-nerfed level 608). Getting two or three stars, however, can be much harder in those same levels. This is quite problematic in mystery quest levels (on mobile) as the player is asked to get the 2-star score in addition to his task. This can be really problematic in levels such as 297 and 463. In these levels, failure to reach the target score will result in the player failing the level without the option to continue by spending gold.
For some reason if you clear a jelly or ingredient level without getting required points for one star, your final score will be boosted to the one-star line and you will pass the level. This does not happen in candy order levels where you will fail after fulfilling the order but do not have enough points even after sugar crush. This also applies to mystery quests, except that if your score is between one-star and two-star line, it will not be boosted now (it was boosted to two-star line in the past).
In the past, the score boosting occurred after Sugar Crush. As of mobile v1.62, it occurs at the moment of completing the objective (i.e. removing last jelly square).
In recent versions (probably since v1.73), candy order levels also received this boost.
The in-game description of score is: "Gain at least xxxxxx points to reach your target!" (It is shown when the mouse pointer hovers above the score section).
When you cursor on the text "Target: xxxxxx points:, an inscription will show up: "You need at least xxxxxx points to reach your target.".
While replaying past levels (other than mystery quests), the target score in the description will become the one to obtain a new star (if you haven't already obtained 3 stars), or the highest record of this level (if you have already obtained 3 stars). This doesn't affect the actual gameplay however.
The web description of score is: "When you match three or more candies of the same color, they burst and you win points."
Count the total cascades in one move, and multiply it with a value depending on how many candies are used in this match. The value is 60 for a 3-match, 120 for a 4-match, 200 for a 5-match, and may be even higher.