You can eat onions (tops & bulb) at just about any stage of their development. The green tops are full of flavour and add a real umph! to your cooking!
Most people want to grow some to keep and aim to have large, hard, 'ripe' bulbs that will last longer. As the onions 'mature' the tops will fold over and the neck (just above the bulb) will shrink. When the tops are almost all gone, lever up the bulbs, shake/wash off the earth and put them somewhere warm and dry to fully dry out. This can happen anytime from June to August (depending on the variety and when you planted them).
The outer skins should be paper dry and the bulbs hard.
If the necks don't shrink, the chances are the bulb won't keep for very long - so use any of those first.