I don't know if any celebrity has retired via Twitter before, but as far as I know, Amanda Bynes is the most famous to do so.  She laid the groundwork for her announcement, noting "Being an actress isn't as fun as it may seem," then dropped the bomb less than an hour later with three consecutive tweets:

If I don't love something anymore I stop doing it... I don't love acting anymore so I've stopped doing it... I know 24 is a young age to retire but you heard it here first I've #retired.

Bynes grew up on the Nickelodeon shows All That and The Amanda Show, moving on to headline romantic comedies such as What a Girl Wants and She's the Man.  Lately she's been more of a supporting player, with a role in the 2007 musical Hairspray and the upcoming Emma Stone high school comedy Easy A.  The latter appears to be her last film, assuming the account has not been hacked, and the announcement is indeed official.