With a federal election scheduled next October 19, the current outlook is that it will produce a minority parliament. While it is possible for either the NDP, the Conservatives, or the Liberals to win an outright majority, none of the three have been polling in majority territory.
Without a majority winner, the party that elects the most members of Parliament will be asked to form a government.
If the Conservatives win more of the 338 seats to be contested than any other party, Stephen Harper can stay on as prime minister -- unless the opposition parties chose to defeat his minority government on a motion of confidence. The earliest opportunity to do that would be the Speech from the Throne that opens a new session of parliament.