Each time you restart your clock, you're throwing away any time over 1 second. This is going to accumulate more and more causing your countdown to be inaccurate.
I modified your code to count down without any accumulation issues. Also, you don't need the header guard in a .cpp file.
#include <iostream>
#include <string>
#include <SFML/Graphics.hpp>
#include <cmath>
int main()
{
sf::RenderWindow window;
window.create(sf::VideoMode(800, 600), "TITLE", sf::Style::Close | sf::Style::Resize);
window.setFramerateLimit(60);
sf::Font font;
if (!font.loadFromFile("Enchanted Land_0.otf"))
{
}
sf::Text text;
text.setFillColor(sf::Color::Red);
text.setFont(font);
sf::Event events;
sf::Clock clock;
while (window.isOpen())
{
sf::Time time = clock.getElapsedTime();
const int countdownNumberOfSeconds = 10;
const int timeleft = countdownNumberOfSeconds - std::floor(time.asSeconds());
text.setString(std::to_string(timeleft));
if (timeleft <= 0)
{
text.setString("GAME OVER");
text.setPosition(window.getSize().x / 2, window.getSize().y / 2);
}
while (window.pollEvent(events))
{
if (events.type == sf::Event::Closed)
{
window.close();
}
if (events.type == sf::Event::KeyPressed)
{
if (events.key.code == sf::Keyboard::A)
{
window.close();
}
}
}
window.clear(sf::Color::Blue);
window.draw(text);
window.display();
}
}