Bale, who made 111 appearances for Wales and won 22 trophies, including 5 Champions Leagues, confirmed the decision on social media.
The former Southampton, Tottenham and Real Madrid forward made his final competitive appearance during Wales' World Cup group stage fixture with England on November 29.
Bale wrote on Instagram: "After careful and thoughtful consideration, I announce my immediate retirement from club and international football.
"I feel incredibly fortunate to have realised my dream of playing the sport I love.
"It has truly given me some of the best moments of my life. The highest of highs over 17 seasons, that will be impossible to replicate, no matter what the next chapter has in store for me.
"From my very first touch at Southampton to my last with LAFC and everything in between, shaped a club career that I have an immense pride and gratitude for. Playing for and captaining my country 111 times has truly been a dream come true.
"To show my gratitude to all of those that have played their part along this journey, feels like an impossibility. I feel indebted to many people for helping to change my life and shape my career in a way I couldn't have ever dreamed of when I first started out at nine years old.
"To my previous clubs, Southampton, Tottenham, Real Madrid and finally LAFC. All of my previous managers and coaches, back room staff, team mates, all the dedicated fans, my agents, my amazing friends and family, the impact you have had is immeasurable."