If a trial is offered, its length and price are shown on the store's subscription screen before you confirm, and Apple or Google handle the charge and the switch to a paid subscription. Cancel before the trial ends, through your store account, to avoid being charged.