You can't. You either need to marry or become common-law partners (after living together for a minimum of a year).
She can "visit" you but she can't "move" here until she gets PR status or other "temporary resident" status as a worker or student.
If she is from a visa-exempt country or already has a valid Canadian visa, she can fly here and stay with you while you go through the sponsorship process.
However, if she needs a visa, the chances of her getting one after you get married are very low. IRCC wants you to sponsor her as your spouse, not bring her over as a visitor. Sponsorship takes roughly a year, and you need to show that the marriage was not done purely to immigrate to Canada. Since you just met online and haven't actually met (I presume), you need to first build a relationship history.
If you meet someone online and get married a few weeks/months later the very first time you meet in person ... that marriage is going to look highly suspicious.
That will always be up to the CBSA officer they encounter at the border. The default visit is six months - however the CBSA can chose to allow them in for a shorter period of time.