Any time you are first to enter the pot you will have the option of folding, calling or raising. Assuming you find a hand you consider playable, however, you should only be open-limping in early position, or in late position if other players have limped in front of you. This is because the closer you are to the button and the blinds the more valuable it is to you to try and force the other players out with a raise to gain position and try to pick up the blinds uncontested, particularly as they increase in size.
Limping in mid- or late position when other players have already limped is acceptable, however, as you will already be getting inviting pot odds as well as the security of good position and the reduced likelihood of anyone raising behind you. In fact, with a marginal hand in mid-or late position you should be more inclined to limp after other players than raise than you would in a cash game or tournament in order to avoid creating large pots where you are only a marginal favourite.
Assuming that you play better than the majority of your opponents and have a favourable table for limping in early position (i.e. one that is predominately loose-passive), you may want to limp with small to medium pairs and even good suited connectors, as well as some hands that you might otherwise raise in order to balance your overall limping range. You will also want to limp in early position sometimes in a loose-aggressive game, but here it will be with the intention of reraising with your strongest hands (Q-Q+ and A-K). Note that suited connectors, small pairs and medium strength aces are difficult hands to play profitably in early position in a light or loose-aggressive game and that consequently you should usually fold them.
Once one or more players have limped in front of you most of the hands mentioned above will be playable in mid-late position, although in marginal situations you should also consider the type of game you are in and your skill level. In very favourable situations, like on the button when several mediocre players have limped or on the small blind after limpers you may also want to call with gap-connectors (e.g. 9-7s), any Broadway hand and suited rag aces, as you will be getting excellent pot odds.
Except in these situations you should usually enter the pot with a raise of 3-4 big blinds if you intend to play a hand - that is anytime you have five or fewer players behind you, unless you are in an exceptional situation like being the small blind when everyone else has folded. Most of the hands above can be raised from late position, and you should also usually be raising in early position with very strong hands that you wish to play (unless you have a reason to trap) and after limpers, where you should add on approximately one big blind to your raise for each limper.