When you upgrade during a running billing cycle, Shopify prorates the new subscription charge.
The amount due depends on three things: what you have already paid, the cost difference between the plans and the time left in the current billing cycle.
The calculation formula is:
plan1_cost + (plan2_cost - plan1_cost) * (cycle_days_left / total_cycle_days) = total_cost
For instance: you start a 30-day billing cycle on the Basic plan at $17.50 and upgrade to Growth at $29.95 on day 15. The charge for the upgraded plan is $23.73.
$17.50 + ($29.95 - $17.50) * (15 / 30) = $23.73
For further explanation please have a look at the Shopify article App Charges.