You can trade according to the condition of the market and duration of your trading depend on your trading plan and startegy.
When it comes to trading securities, short-term and long-term trading are both viable options. It is perfectly possible to generate substantial profits with either type of trading strategy. The most important thing is to discover which way suits your needs. You can determine which is best for you based on your Capital Requirement, Time Commitments and Personality and Skill Characteristics.
You need to look at your trading strategy - is it based on short-term price movements (like scalping) or longer-term trends? Short-term strategies might have quicker trade durations. Secondly, keep an eye on the timeframes you're trading on - shorter timeframes usually mean shorter trades. Also, consider the currency pairs you're trading - some tend to be more volatile and might result in shorter trades.
What does it mean actually? How long do I keep my trades open? As a scalper, I try to take not more than 5 to 10 pips so it can be 10 to 15 minutes at large.
Statistically, you want to stay in your profitable trades longer than your losers. So, one needs to come up with timeline that you will hold the trade and within that, at what point do you decide to close the trade or leave it open.