You need to complete 10 different levels with 3 stars each. You cannot get 3 stars on one level 10 times; it has to be 10 different levels.
Some levels are timed, with the amount of stars depending on the amount of time you take and damage you take. There is no time limit.
Others depend on the number of packages you collect in a certain time period. The more packages, the more stars. You have a certain amount of time to collect a certain amount of packages.