Author
An author creates and publishes original written works, like books, articles, essays, or other long-form content. Being an author usually means you own the ideas and words you’ve written, and your work is often finished and formally published. Most people think of authors in terms of books—fiction or nonfiction—but it can also include academic papers or other published works.
Writer
A writer is anyone who produces written content, which can include authors but also a much broader range of writing. Writers might create blog posts, articles, marketing copy, scripts, social media content, or other text. Not all writers are authors, because their work might not be a long-form original piece or formally published under their name.
In short: all authors are writers, but not all writers are authors. Authors usually have original, published works with their name on them, while writers can create all kinds of written content in many different settings.