As this is really important, I'd like to dedicate a new thread to it:
613.1a Layer 1: Copy effects are applied. See rule 706, “Copying Objects.”
613.1b Layer 2: Control-changing effects are applied.
613.1c Layer 3: Text-changing effects are applied. See rule 612, “Text-Changing Effects.”
613.1d Layer 4: Type-changing effects are applied. This includes effects that change an object’s card type, subtype, and/or supertype.
613.1e Layer 5: Color-changing effects are applied. 613.1f
Layer 6: Ability-adding and ability-removing effects are applied.
613.3a Layer 7a: Effects from characteristic-defining abilities are applied. See rule 604.3.
613.3b Layer 7b: Effects that set power and/or toughness to a specific number or value are applied.
613.3c Layer 7c: Effects that modify power and/or toughness (but don’t set power and/or toughness to a specific number or value) are applied.
613.3d Layer 7d: Power and/or toughness changes from counters are applied. See rule 120.
613.3e Layer 7e: Effects that switch a creature’s power and toughness are applied. Such effects take the value of power and apply it to the creature’s toughness, and take the value of toughness and apply it to the creature’s power.
In context:
Gray Ogre, a 2/2 creature, is on the battlefield. An effect puts a +1/+1 counter on it (layer 7d), making it 3/3. A spell targeting it that says “Target creature gets +4/+4 until
end of turn” resolves (layer 7c), making it 7/7. An enchantment that says “Creatures you control get +0/+2” enters the battlefield (layer 7c), making it 7/9. An effect that says “Target creature becomes 0/1 until end of turn” is applied to it (layer 7b), making it 5/8 (0/1, plus +4/+4 from the resolved spell, plus +0/+2 from the enchantment, plus +1/+1 from the counter).