Kisal is correct: don't take all the leaves. Sunlight + leaves = photosynthesis = plant growth.
However, I have been known to clip one or two or even three "leaves" from an onion plant and chop them up for use as scallions. Just make sure never to take more than one-third of the greenery from any plant, and on an onion be sure only to cut outer (smaller) leaves, not the inner (larger) ones.
Sunset Zone 17, USDA Zone 9