Half a megabyte keeps a photo at nearly full phone resolution with excellent JPEG quality. It is also the bottom of the range Instagram tolerates best, which is why the Instagram presets on the homepage start at 500 KB. Use this page when a site tells you the upload is too large but you still want the photo to look untouched.
At 500 KB you can expect up to about 2000 px on the long side. The exact number depends on how much fine detail the image has: skies and plain walls compress well, foliage and fabric don't.
Tip: For screenshots and UI images, PNG at reduced pixels can look cleaner than JPEG. Try both from More options.