If you have played while linking your Facebook account, your level progress will be stored on your Facebook account and will not be lost. However, if you did not link your Facebook account, your progress will only be saved locally (on the device) and will therefore be lost when the application is deleted or the phone restored to factory settings.
The items in your inventory (lives, coins and boosters) are stored locally on your device (computer, tablet and mobile phone). You're not able to transfer your items across devices. This is to prevent graphical errors and crashes/freezes.
If you want to ensure you get your coins, lives or boosters on a specific device, make sure you use that device when you first collect or buy them. For example, if you'd like to accept lives from a friend and want them to show up on your mobile device, you'll need to accept these lives on your mobile device. This includes coins and boosters as well. If you purchase them on your mobile device, they'll only be available on your mobile device.