The general rule when close to the green is putt it if you can. If you can't putt it then chip it and if you can't chip it, lob or pitch it.
In the picture below you will see 3 different ball positions:
Position #1 (Putt it): If the ball is on the fringe with smooth grass in front, that is, no bumps, lumps or sprinkler heads in the way that will distort its roll, then you can putt it. Otherwise, chipping may be the next best shot choice.
Position #2 (Chip it): If the ball is too far off the green to putt it and there aren't any large obstacles in the way then chip and roll (bump and run). Remember: a chip is designed to fly low and then roll out like a putt, so read the green first. In position #2 the ball is in the second cut of grass (long grass) and would not provide a smooth putting surface....chip it over the the second cut of grass to the green and let it roll.
Position #3 (lob/pitch it): If the ball is farther back and there are obstacles in the way that need to be flown over (e.g. hill, ridge, bumps, sand bunker, water, etc.) then lob/pitch it to the green. A lob is designed to fly high with little roll. In position #3 the ball is down a hill and there is a ridge in the way so lobbing is the optimal shot selection.