The boy, who wore a colourful Balinese shirt and a balaclava to hide his identity, will be freed on December 4 after the court ruled the nearly eight weeks he has already spent in jail should be counted against the sentence.
The teenager bowed his head as judge Amser Simanjuntak pronounced sentence at Denpasar district court.
He was arrested with 6.9 grammes (quarter of an ounce) of marijuana on October 4 in the tourist area of Kuta, where he was on holiday with his parents, and charged with possession.
As a minor, the boy could have been jailed for up to two years but prosecutors only sought a three-month term, considering his youth and the likelihood he would change his behaviour.
He also avoided a lengthier sentence by agreeing to undergo drug rehabilitation. He had admitted to having the drugs.
Australian Foreign Minister Kevin Rudd thanked Indonesian authorities for their speedy handling of the case.
"This has been obviously a traumatic time for him and his family. I'm sure there are lessons to be learned by this young man as well," Rudd said.
"We'd like very much to thank the Indonesian authorities for their assistance in the conduct of this case, for the speedy way in which it's been handled against all Indonesian norms," he added.
"I think it's good that this family and this young man, it looks like, will be home for Christmas."
The judge said the boy had conducted himself well throughout the trial.
"The defendant has never committed any crime before. He has always been polite during hearings," the judge said.
"He regretted the crime he committed. He promised to never repeat the same mistake and his parents have promised to send him to a rehabilitation centre as he is still in junior high school."
After sentence was passed bodyguards immediately encircled the teenager to protect him from dozens of journalists, who were for the first time allowed to witness the trial.
The boy had arrived at the court with his father and six bodyguards from his lawyer's office. They were forced to push through a scrum of journalists to reach the courtroom.
Despite the light sentence, the boy's lawyer told AFP he was disappointed with the ruling.
"We had expected that the boy would be returned to his parents immediately to undergo a rehabilitation programme," Muhammad Rifan said.
The boy's father, donning a baseball cap and sunglasses, stood by his son during the trial, while the boy's mother "was not strong enough" to attend, Rifan said.
"The boy's parents are considering the ruling. They most probably won't appeal as this is likely the best result, realistically," Rifan said.
The teenager's legal team argued he belonged in rehabilitation rather than jail because he had a history of drug use.
Several Australians have been arrested for drug possession on Bali in recent years, including two traffickers on death row and six serving life sentences.