Historically, the seemingly obvious answer would be two or twice—twice by the United States against Japan in World War II. This is what a simple Google search would yield also. While that is reasonable, the trick of the trick question is in the meaning of used. If we consider the fact that coercion includes not only direct acts of violence, but credible threats of violence, then nuclear weapons have been used dozens of times since WWII. Indeed, nuclear weapons—being an inescapable aspect of the post-WWII era—are used all the time, by the US and other states.
Lest we are tempted to think this is just a matter of overly dramatic or technical wordplay—nuclear weapons were only really used when they were dropped, not every time they were considered or threatened—consider the following example. A man with a gun points it at another man and demands his wallet. The second man—not wanting to be shot—hands over his wallet. The first man runs away, never firing the gun. Later, were the first man to be arrested by the police for robbing the other man at gunpoint, no one would accept the argument that he did not actually use the gun just because he did not ultimately fire the gun. He would rightly be considered a robber and charged with assault with a deadly weapon.
There may even be another time that they have been explicitly used. It is suspected that they have been used in the MidEast. There are reports of heavy explosions and some residual radioactivity. There is also evidence in North Africa and the Sub-continent of glass made by nuclear explosions with very little residual radiation. What can you say about these situations but not said in the article?