You mainly get one from professor Elm.
However, if you get a complete match at the Goldenrod lottery then your prize is a Master Ball.
you only get one unless you use a cheat code or its a special event
You can get 2 Master Balls in both versions.
you can get 1 master ball
i masterball
one
1
1
1 ONLY
You can clone a Pokemon with the master ball or trade it to a friend and keep starting over until you're satisfied with the number of master balls.
There is one you get for playing the game. You can win them in the lottery in the game. Also if you cheat you can have a billion if you really want to.
Attach your master ball to ONE POKEMON, next CLONE that Pokemon for how many master balls you want. Next detach them, and release all the clones (if you want)
Duplicate Pokemon with a masterball attached to them.