There is no difference in the usage of both tenses in Portugal and Brazil. Pretérito perfeito is for actions that took place and were completed in the past. Pretérito imperfeito is used for an action that began in the past but lingered in time.
- Dormi muito na noite passada. (I slept a lot last night) - the action was fully completed in the past
- Quando era pequena, dormia muito. (When I was a child, I used to sleep a lot) - the action began in the past but lasted for a long period or was interrupted
Please note a mistake that is usually made in pt pt that is replacing the present of the conditional mode for pretérito imperfeito of the indicative mode. This may lead to confusion if you read Portuguese texts online, but it's incorrect. Nevertheless, br pt don't mess with these tenses.