I got a Schengen visa through the Greek embassy, but I want to travel to a different Schengen country. Can I just have a transit in Athens, get my passport stamped in Greece, and leave for the other country? Or should I book separate tickets and enter Greece?
If you 'transit' through Greece to another country in the Schengen area that means you will enter Greece.
Immigration will not distinguish between the case where you enter Greece and immediately fly to another place in the Schengen area and the case where you enter Greece and stay there. Both require you to fully clear immigration. The flight from Greece to the other place will count as an internal flight within Schengen.
There is the issue that you were granted the visa on the assumption that Greece was your main destination, and that now seems to be not the case. If immigration suspects this was deliberate they may deny you entry and revoke the visa, or it may cause trouble with later applications. You should have a good explanation of why your plans have changed, and if you don't have one the safest route is to apply for an entirely new visa. In either case the question of whether you "book separate tickets and Enter Greece" will make no difference.