I know that every object have a dual property but the wave nature is not observed because of their size. But in the photoelectric effect, light is not considered as a wave then how can we talk about its frequency (threshold frequency) if its not a wave? Or is light considered to be a wave as well when we talk about its frequency?
Wave-particle duality is a complicated philosophical idea with many different interpretations. It sounds like you're new to this so I'm going to give you a simple answer you can rely on to solve problems. Once you get the hang of things you can check out exotic ideas like the many-worlds interpretation.
Think about yourself. You are both a human being (a single object) and a collection of organs (many different objects). The fact that you are a human being doesn't mean that you aren't a collection of organs. Similarly, the fact that you are a collection of organs doesn't mean that you aren't a human being. They are two different ways of looking at the same thing.
Whether we view you as a human being or a collection of organs depends on the context. A lawyer determining your guilt of a crime would consider you a human being. A doctor performing a heart transplant would consider you a collection of organs. Both of them are correct. They use the appropriate model for the appropriate situation.
In the photoelectric effect it's better to treat light as a particle. That doesn't mean light isn't a wave. You could model the photoelectric effect perfectly accurately while treating light as a wave. But that is way harder than modelling the photoelectric effect while treating light as a particle so we treat light as a particle when modelling the photoelectric effect. On the other hand, if we want to discuss light's frequency then it's simpler to use the wave model of light than the particle model of light.
Does everything have frequency? As far as we can tell, yes it does. The frequency of a particle is equal to the particle's energy divided by Plank's constant. Usually we talk about De Brogie wavelength instead of frequency, but conceptually they're the same thing.
It is quite annoying that after almost a century of QM, and half a century of QFT, people are still mislead by the persistence of questionable interpretations like the (in)famous duality. The position of Richard Feynman, more than 50 years ago was crystalline clear:
The electrons arrive in lumps, like particles, and the probability of arrival of these lumps is distributed like the distribution of intensity of a wave. It is in this sense that an electron behaves “sometimes like a particle and sometimes like a wave.”
Which is not equivalent to a vague statement about electrons which may behave in some cases as particles ad in other cases as waves. It means that the dynamics is always described by wave-like properties of the evolving probability amplitude, while measurements are always described as in the case of classical particles by yes/not results (either the full charge is measured or no charge, either the full spin is measured or no spin, only a full particle is detected and no fraction of a particle has ever been measured). A good summary of the reasons Wave-Particle Duality should be eliminated from modern introductions to QM is nicely given in the Klein's page cited in the juanrga's answer to this SE question.
Photoelectric effect is actually quite a subtle topic as far as the corpuscular character of the light is concerned. Historically, Einstein's explanation was the first to appear, but it pre-dates the proper QED treatment of photons. Moreover, just one year after Schrödinger published his famous equation, Wentzel was able to show that Einstein's conclusions about photo-electrons could be obtained within a QM treatment of the electrons in the presence of a classical radiation field. Thus showing that the logical link between photons and photoelectric effect is more subtle than previously thought.
So, what about the frequency (or wavelength) associated to a particle?
It should never be interpreted as if the particle would be a wave. This point should be almost obvious if one reflects about the case of two particles. Their wavefunction does not live in the 3D space as an ordinary wave. The wave in the 6D configuration space controls the dynamics through its interpretation as probability amplitude. It is possible to meaningfully speak about frequency and wavelength of such a wave, but always bearing in mind that frequency and wavelength are physical properties of the probability amplitude, not of the particle/particles. For this last conceptual step, there is nothing in the formalism allowing such conclusion.