PIC Pin 3V to 12V Boost Circuit
The schematics you see is a basic PWM controlled boost converter, with no feedback loop: this is extremely dangerous. The 12V at the output is not guaranteed.

The math behind how you calculate these values is fairly complex. 
See:
https://en.wikipedia.org/wiki/Boost_converter
or this paper by TI: http://www.ti.com/lit/an/slva372c/slva372c.pdf
Where the switch is your PWM controlled transistor opening and closing at a very high frequency.

As a result, no one designs raw boost converters like that. You should use a dedicated boost converter IC. There are seriously TONS of them. Texas Instruments (again -- no I don't have anything to do with them...) has a fairly good selection of them.