How to write it
Describe what the image shows and why it is there, in a sentence or less: Dentist explaining an X-ray to a patient, not image123 or dentist dental clinic best dentist. Do not start with picture of. If the image contains important text, include that text.
When to leave it empty
Purely decorative images, such as background shapes, should have an empty alt attribute (alt="") so screen readers skip them. Icons next to a text label also usually need no description, because the label already says it.
Questions, answered
It helps search engines understand images and can help image search, but its main purpose is accessibility. Do not stuff it with keywords.
Usually under about 125 characters. Complex images such as charts need a longer description nearby on the page.