It depends on how you want your ski to handle; it's just a matter of finding what's comfortable. I know people who are 6' tall and ride 170s, or kids who are 5'4" and ride 180s without struggle.
A shorter ski is easier to move around, which also makes it less stable. A longer ski takes more effort to maneuver, but is also stable on bigger hits.
Finding a ski length that you like is a comprimise of the two. If you like park/rails, then you might like a shorter ski. If you like charging bumps/all mountain then a longer ski would be better.
Also remember that you can compensate for length using flex. If you want a short ski with more stability, you could get a stiff ski in a short length. Or if you like butters but want stability, you could get a long, soft ski.