I know that whenever somebody makes something and we want to use it, it is better to contribute to them and pay for it. But I have nothing to hide: I have used fonts illegally a few times. Is it possible that someday somebody will contact me because of this? As fonts are sold in various online shops can they determine from where I bought it, or that I did not buy it at all?
It's almost redundant to point out that violating someone's copyright is not only unethical, it is illegal. And, yes, it is certainly possible that someone might "contact" you on the subject, depending on the circumstances. If you have no license to use a particular font, but you gained financially by using it, you don't have a defense. "Possible" is not the same as "likely," however, so you probably don't need to move to a new city and change your name (not right away, anyway).
It is better to pay for something you use, not just for the person who created it but for you, too. Consider that you would not have asked this question if you didn't feel uneasy about it.
That's my answer. What follows are my opinions.
Artists and innovators put a lot of themselves into what they do. Copyright and patent laws are there so that they can receive a decent exchange for their work and not be ripped off. The fact that anyone can copy a book, a font or a piece of music makes it easy to ignore or forget that the person who created it has a family and pays rent or a mortgage. A font is usually a one-person effort; a good font takes hundreds of hours of painstaking work. Buying a license is the least one can do to give back for the opportunity to benefit from it.
For better or worse, we live in an era where it's incredibly easy to steal little bits of someone's livelihood without apparent consequence. It is an unfortunate fact of human nature that when we do something we know is wrong, we justify it by doing it again. Pretty soon it becomes a habit. It can become a compulsion. "Everyone else does it" helps us to justify it some more. Peace of mind and a happy life are easier to attain when we don't do things that we have to justify.
A couple years ago a publishing company in the UK was beset upon by the Business Software Association for unlicensed use of fonts in their titles. A former and disgruntled employee gave the tip. The publishing company had to pay well into the six figures in fines as a result of the audit, far more expensive than if they just paid for the licenses up front.
Fonts can be very expensive despite them not being nearly as prominent as Photoshop (though unarguably more ubiquitous than Photoshop), but they should be treated like any other software license. If you use a version of a font that someone sells, you should pay for the licenses needed to create and distribute your work.
With any copyrighted work, it is easier to ask permission than beg forgiveness, especially when the copyright holder is openly offering permission in exchange for something simple like a fee and/or a credit line.
I know this isn't the answer you are looking for, but I think you are asking the wrong question.
There is more to sustainability than just "can I get away with this?". If you are planning to make a career in design you will need to get paid for your efforts. By not legally purchasing a product that is commercially available, you are tacitly endorsing a culture that rips-off creators.
Whether you see immediate side-effects or not, it is not in your best interest to promote a culture that devalues your chosen line of work.
First off I agree with Alan and other posters answers regarding the ethical and right thing to do. As a designer who is paid for creative work it's just wrong to not respect others creative work.
With that being said the actual legalities of it depend on what country you live in but in the U.S. most of the actual federal laws that are punishable criminally are mostly geared toward sound and video recording copyright infringement.
If you did not reproduce the font and distribute it you have not broken any U.S. criminally punishable law. If you only used a font in your work that you were not licensed to use then you can not be punished under the law. If you distributed the actual font with your work then maybe you could be punished.
You can be held civilly responsible and get sued by the copyright owner and you have also put your client at risk because they could be sued as well. I have a clause in my contract that regarding the use of copyrighted or unlicensed material that my client can't be held responsible for something I provide them and that I can't be held responsible for something they provided me.
Also the answer to your question depends on what your definition of illegal is. Does illegal mean the police can lock you up or does it mean that you can be held civilly and financially responsible.
Worst Case Scenario
Other License Violations
There are lots of other issues with font license violations than simply not paying for a license. Even when you purchase a font sometimes the license prohibits you from using it in certain commercial works like in a logo but allow you to use it for other printed materials. Most fonts prohibit web embedding or converting to a different format for web embedding.
Some fonts allow you to send a copy of the font to a printer for the sole use of reproducing the work you created but some strictly prohibit this.
Respect the intellectual property rights of other creatives just as you would want your rights respected. This is what separates design professionals from your clients cousin who knows a kid down the street with a copy of Photoshop.
Here's a little bit about the subject should you ever need it - Defence against Font Piracy
The consequences of using an unlicensed font is the same as the consequences of using any unlicensed software. It's an intellectual property violation.
The penalties for IP violations range from:
Given the latter exceeds the total economic worth of the planet, one would assume that's the upper limit, but you never know with the likes of the RIAA.
The reality is you will get in trouble if a) you get caught and b) there is someone out there with the resources to sue you over it.
In the world of type face design, this has happened. Ad agencies and design firms have been sued for using typefaces in ad campaigns for clients without seeking and paying for the proper licenses.
So that's all the legal stuff.
On a simple professional level...as one designer (you) to another (the typeface designer) you should pay for the font. That's how more fonts get created. A font is a tool for you to do your job and, as such, you should value it, take care of it, and obviously charge enough for your own work to afford the tools of your trade.