Nicola Sturgeon spoke directly with Mr Johnson for the first time since the SNP won an emphatic victory in Thursday's Holyrood election.
Earlier, Ms Sturgeon said she did not expect the debate to end up in court.
A senior UK government minister appeared to suggest it would not mount a legal challenge to her plans.
During a phone call with Mr Johnson on Sunday afternoon, the first minister pledged to work with the UK government on steering the country through the Covid pandemic towards recovery.
The SNP said the leaders also agreed the importance of both governments working together "closely and constructively" to make the forthcoming UN climate conference in Glasgow a success.
But a party spokeswoman added: "The FM also re-iterated her intention to ensure that the people of Scotland can choose our own future when the crisis is over, and made clear that the question of a referendum is now a matter of when - not if."
The UK Government said Mr Johnson spoke to the first minister to "congratulate her on her party's success" in the Scottish Parliament election.
A spokesman said the prime minister emphasised "the importance of focusing on Covid recovery at this time".
He added: "They both agreed that their immediate focus should be on working together to build back from the pandemic.
"The Prime Minister reiterated his invitation for the first minister to join a summit meeting to discuss our shared challenges on Covid recovery and how we can overcome them."
Meanwhile, appearing on the BBC's Andrew Marr programme, Nicola Sturgeon was questioned whether she would introduce a referendum bill as early as next spring based on predictions that the UK will have recovered in terms of coronavirus circulation and GDP.
She said: "That would certainly work for that timescale of within the first half of the parliamentary term.
"I desperately hope those predictions are correct but we have to judge that as we go through this year. We've still got significant challenges ahead. I wouldn't rule that out but I'm not sitting here saying that is the timescale."
Mr Johnson earlier invited Ms Sturgeon and her Welsh counterpart Mark Drakeford to a summit to discuss a UK-wide approach to recovery from the pandemic.
He has said it would be "reckless and irresponsible" to have a referendum right now, and the UK government is not currently expected to grant formal consent for a vote to be held - as it did ahead of the 2014 referendum.
There has been speculation that the row could end up with the courts being asked to rule on whether the Scottish government has the power to hold a referendum without the UK government's agreement.
But Ms Sturgeon said she did not believe either side wanted a legal battle over the issue.
She said: "The UK government knows that if we ever get into a situation where this is being determined in the courts then actually what the UK government is arguing is that there is no democratic route for Scotland to have independence.
"The implications of that would be very grave indeed. If the argument of the unionist side is that Scotland is trapped it strikes me that that is one of the strongest arguments for independence."
Ms Sturgeon also said it would be "absurd and completely outrageous" if the UK government went to court over the issue and that it was "up to the Scottish people" to decide the country's future.
Her party stood on a manifesto to steer the country out of the pandemic, and to then hold a referendum, which she said people had "voted overwhelmingly for".
She added: "The fact that we are sitting here having a debate about whether or not that outcome is going to be respected says a lot about the lack of respect for Scottish democracy that this UK government has demonstrated for quite some time now."
Also appearing on the programme, Cabinet Office Minister Michael Gove said he would "not go near" the issue of the UK government potentially challenging a referendum bill in court.
He said: "Whatever parties we come from, the priority at the moment is not court cases, it's not independence legislation - it is recovery from the pandemic."
When asked if Scotland was allowed to leave the UK, he said: "Of course it is, through a legal referendum which would allow people to make that choice."
But he also insisted that the SNP's failure to win an overall majority showed that the people of Scotland were not "agitating" for a referendum.
The SNP finished on 64 seats in Thursday's Scottish election - one short of a majority but one more than it won in 2016 - while the Conservatives won 31, Labour 22, the pro-independence Scottish Greens eight and Liberal Democrats four.
But Mr Gove said a majority of voters - 51% - had backed parties that were opposed to independence in the constituency ballot - although the same percentage voted for pro-independence parties in the regional list ballot.
BBC Scotland's Sunday Show later asked Mr Gove to clarify the indication he gave to Marr that the UK government would not mount a legal challenge to a Scottish independence referendum bill.
Mr Gove said: "We are not going to go down the route of talking about independence or legal challenges or anything like that now when our principal focus and exclusive attention is going on pandemic recovery.
"At the moment all we want to do is work with the first minister to concentrate on dealing with the consequences of the pandemic and the need to recover and build back better."
Mr Gove denied he was giving the Scottish government a green light to pass a referendum bill, saying "we are concentrating on recovery at the moment".
In her victory speech, Ms Sturgeon said her priority was leading the country through the pandemic - but said she still intended to hold an independence referendum once the crisis has passed.
In a letter to Ms Sturgeon published on Saturday night, the prime minister invited Ms Sturgeon to "discuss our shared challenges", adding "we will not always agree - but I am confident... we will be able to build back better, in the interests of the people we serve."
Mr Johnson said the country needed to "show the same spirit of unity and co-operation that marked our fight against the pandemic" in engineering a Covid-19 recovery.
But he warned it would be a "difficult journey", adding: "The broad shoulders of the UK have supported jobs and businesses the length and breadth of the country, but we know that economic recovery will be a serious shared responsibility."