You can keep a position open for as long as you want, but keep in mind that a swap fee (positive or negative) will be applied for carrying the position over to the next trading day. This applies to stocks, currency pairs, metals, and cryptocurrencies.