This mostly depends on the size of the place you're referring to. In fact, you could also add "à" in your question.
Here are some general rules.
En: for large places with a feminine name
In general, we use "en" for large places, like countries or regions, when they are singular and feminine names or begin with a vowel. That is in fact, countries or regions for which you would use "la" or "l'" to refer to them:
Countries: En France, en Allemagne, en Italie, en Grande-Bretagne, en Iran (masculine name, but begins with a vowel)
Regions: En Auvergne, en Île-de-France, en Picardie, en Californie, en Corse
Au/aux: for large places with a masculine or plural name
For other country names, we use "au" or "aux" (for plural). That is in fact, countries or regions for which you would use "le" or "les" to refer to them:
Countries: Aux USA, au Canada, au Japon, au Bénin
Regions: Au Kamchatka, au Connemara
À: for local places
For localized places, like cities, towns or villages (and sometimes small countries), we use "à":
Cities: À Paris, à Lyon, à Bordeaux
Small countries: À Monaco, à Taïwan, à Cuba
Note that Andorra is not bigger than Cuba, but we say "En Andorre".
Dans: for very localized places
For very localized places, like a house or a box, we use "dans":
Dans ma maison, dans cette boîte, dans le jardin
Exceptions to the rules
There are however exceptions (otherwise it wouldn't be fun):
Regions: Dans le Berry, dans le Limousin
Cities: En Avignon
Generic places: Dans le ciel, dans la mer
Expressing time
To express a lapse of time to wait for, we always use "dans":
Je pars au Canada dans 3 jours, dans 1 mois, dans un siècle
To express a lapse of time necessary to achieve an action, we use "en":
Le tour du monde en 80 jours