If someone has shared a query with you it will show up in red letters under your "Shared Queries".
Although you are unable to edit this particular query (the creator retains control over it), you can simply click "Save As:"
and then you can rename it and edit your own copy of the query!