It depends so much on the area. Here in Phoenix, you can't camp ANYWHERE except at a campground or well outside of town on BLM land. There are ordinances prohibiting any and all kinds of overnight parking anywhere. Same thing up in Reno from what I've heard. Maybe it's to prevent Walmarts from turning into transient camps, I dunno, but it's annoying.
I suggest carrying a Ouiji Board if you're going to camp at a cemetery. That way if cops or anybody else asks why you're there, you can whip out the board (slowly, so you don't get shot) and tell them you plan to use it around midnight. :)