As sempalscuba said in his answer, there is no way to be certain what numeral a future monarch will choose to use, but going by the practices in the past it is most likely that a future queen regnant of the UK named Mary will known as Mary the Third.
I note that if Prince George (born 2013) has children, as he probably will, and if his oldest child is a girl and is named Mary, that will be the soonest that another Queen Mary could reign in the UK. And considering the average length of generations in the Royal family and the present age of the Queen, the hypothetical oldest child of Prince George, whatever his or her first name will be, will probably not reign until about 2100.
However, I can point out that it would be equally logical for the next queen regnant of the UK to be known as Mary the First.
The Kingdom of Scotland dates aback to AD 843, more or less, and the Kingdom of England to 927. In 1542 King Henry VIII of England turned his Lordship of Ireland (created in 1177) into the Kingdom of Ireland. In 1707 the Kingdoms of England and Scotland merged into the new Kingdom of Great Britain. In 1801 the Kingdoms of Ireland and Great Britain merged to form the United Kingdom of Great Britain and Ireland. In the 20th century most of Ireland broke away from the United Kingdom and the title of the Kingdom was eventually changed to the United Kingdom of Great Britain and Northern Ireland.
And it is perfectly logical to start the numbering of monarchs over again at one every time an old kingdom is abolished and a new one created.
The creation of the kingdom of Great Britain didn't affect the numbering since Queen Anne was the first and so far last Queen regnant named Anne, and the next three monarchs were the first British monarchs named George.
But when George III went to bed as King of Great Britain, Ireland, and France on December 31, 1800, and woke up as King of the United Kingdom of Great Britain and Ireland on January 1, 1801, he could logically have changed his number to George I.
Then George IV (1820-30) would have Been George II, William IV (1830-37) would have been William I, Victoria )(1837-1901) would have been Victoria, Edward VII (1901-1910) would have Been Edward I, George V (1910-1936) would have been George III, Edward VIII (1936) would have been Edward II, George VI (1936-1952) would have been George IV, and Elizabeth II (1952-) would be Elizabeth I, Prince Charles presumably Charles I instead of Charles III, Prince William William Ii instead of William V, and Prince George George V instead of George VI, and so on with as yet unborn generations.
With another twist, Queen Victoria of the UK (1837-1901), became Empress Victoria of India in 1876, and George VI gave up the title in 1948.
So if the UK monarchs were numbered as Emperors of India:
Queen Victoria (1837-1901) would be Empress Victoria of India (1876-1901)
King Edward VII or I Would be Emperor Edward I of India (1901-10).
King George V or III would be Emperor George I of India (1910-36)
King Edward VIII or II would be Emperor Edward II of India (1936)
And King George VI or IV (1936-52) would be Emperor George II of India (1936-1948).
It is always possible that in the future Wales, or Scotland, or Northern Ireland, or England, might become independent, turning the United Kingdom into a divided kingdom. And if that happens it might be considered logical to start the numbering of monarchs over again.
If Scotland becomes independent, the remaining country could be called the United Kingdom of England and Northern Ireland, and perhaps add Wales to the title. If that happens, a future King Robert or James of the United Kingdom of England, Wales , and Northern Ireland would be Robert the First or James the Third, while a future king Robert or James of Scotland would be Robert the Fourth or James the Eighth.
And it is possible that Scotland might become an independent Kingdom before there is another queen regnant named Mary. In that case the next Queen egnant of the kingdom that includes England (whatever name it might have) will be Mary III, and the next Queen regnant of Scotland will be Mary III.
And if Scotland continues to have the same monarch as the remnant of the UK (at the present time fifteeen other countries have the same monarch as the UK) Queen Mary III of the remnant of the UK and Queen Mary III of Scotland will be the same persons.
And if Scotland chooses to have a different monarch, there could be different Queens Mary the Third in the two countries at different times.
If Northern Ireland becomes independent, and maybe joins the Republic of Ireland or the USA, the United Kingdom might change its name back to Great Britain. And then it might be considered logical to change the numbering of monarchs back to Great Britain numbers, ignoring the numbers used by monarchs of the United kingdom. So under that system Prince Charles would be King Charles III, Prince William would be King William IV instead of William V, and Prince George would be King George IV instead of King George VII.
So even though precedents suggest that the next queen regnant named Mary in the British Isles will almost certainly choose to be known as Mary III, there is no legal need for her to be known as Mary III, and possible future events and/or her personality traits might make her Choose to be known as Mary I or Mary IV or some other number.