Which Macro to tell the difference between PIE and WindowNoEditor?

Assume that you have WorldObject is UWorld* to current game world.

WorldObject->WorldType == EWorldType::PIE
WorldObject->WorldType == EWorldType::Editor

Here is API References

WorldType API Reference

EWorldType::Type